Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

optimizer bug XE

graziano_giulianigma
687 Views
Again another optimizer bug...

The attached code works using O1, not using O2 or O3.
Code works with gfortran 4.6 using -Ofast

ifort -O1 -c date.f90
ifort -O1 -o testdate testdate.f90 date.o

./testdate
1990-01-01T10:00:00
1990-01-01T10:00:00
32872
36000
+ 2 seconds
1990-01-01T10:00:02
+ 86400 seconds
1990-01-02T10:00:02
+ 86400300 seconds
1990-04-12T10:05:02
+ 14 hours
1990-04-13T00:05:02
+ 49 hours
1990-04-15T01:05:02
+ 49 days
1990-06-03T01:05:02
+ 12 months
1991-06-03T01:05:02
+ 12 years
2003-06-03T01:05:02
- 14 days
2003-05-20T01:05:02
2003-05-20T01:05:02
422204702 seconds
-692500 days
1870-01-01T00:00:00
-10950
0
1997-01-01T00:00:00
1997-01-01T06:00:00
1997-01-01T00:00:00
35405
0

ifort -O2 -c date.f90
ifort -O2 -o testdate testdate.f90 date.o

1990-01-01T10:00:00
1990-01-01T10:00:00
32872
36000
+ 2 seconds
1900-01-01T00:00:02
+ 86400 seconds
1900-01-02T00:00:00
+ 86400300 seconds
1900-04-11T00:05:00
+ 14 hours
1900-01-01T14:00:00
+ 49 hours
1900-01-03T01:00:00
+ 49 days
1900-02-19T00:00:00
+ 12 months
1901-01-19T00:00:00
+ 12 years
1912-01-19T00:00:00
- 14 days
1899-12-17T00:00:00
1913-05-19T15:05:02
0 days
-692500 days
1870-01-01T00:00:00
-10950
0
2027-01-01T00:00:00
1900-01-01T06:00:00
2027-01-01T00:00:00
0
0

I am loosing a little bit of trust in optimizer work...
0 Kudos
3 Replies
Steven_L_Intel1
Employee
687 Views
I can reproduce this but am not yet ready to blame the optimizer. Investigating...
0 Kudos
graziano_giulianigma
687 Views
Bumping to keep alive question.
0 Kudos
Steven_L_Intel1
Employee
687 Views
Bumping is not needed. But this is going to take a while.
0 Kudos
Reply