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

Compiler bug?

Espen_M_
Beginner
850 Views

When I compile my code the results from my program differs significantly (ie. not round-off) going from O1 to O2.

However, if I include check:bounds in the O2 compiled build I get back the (correct) results.

0 Kudos
5 Replies
Steven_L_Intel1
Employee
850 Views

Test program, please. There are many possible reasons, few of which are compiler bugs. Most likely based on your description is an uninitialized variable reference.

0 Kudos
Espen_M_
Beginner
850 Views

Shouldn't using check:uninit give me some kind of a warning or error then? (even in release mode?) It doesn't...

I dont't see why bounds checking would have an influence if an uninitialized variable was the problem..?

If the program gives correct results for O1, does this mean that with O1 variables get default initialized but not with O2? It was my impression that unless some option is set nothing is initialized by default..? (not counting default initialized derived types of course)

PS: by "Test program, please" do you mean I should test my program or that you want a test program? Unfortunately the latter would be difficult since I really don't have the time to try and narrow down this error right now (the program is moderately large), and I cannot share the original source. I'm willing to do a bit experimenting, though, if you have suggestions how to find and/or fix the error; but since check:bounds is a quick-fix that does not slow the program very much I'll manage for now :)

0 Kudos
Steven_L_Intel1
Employee
850 Views

Uninitialized variable checking misses many cases. Any change in compiler options, including bounds checking or optimization levels, can change data layout and pattern of memory access. These can reveal or hide errors in your program.

If you believe there is a compiler bug, then you need to provide us with an example program that demonstrates it. First, though, do your own debugging - see where the results start to diverge and see where those values come from.

0 Kudos
jimdempseyatthecove
Honored Contributor III
850 Views

Try adding /Qzero

If this makes the symptoms go away or change, then this is a strong indicator that

a) You are using uninitialized data
b) You expect uninitialized data to contain 0 or 0.0

Both situations are a programming error.

Jim Dempsey

0 Kudos
Steven_L_Intel1
Employee
850 Views

Also add /Qsave.

0 Kudos
Reply