[Bug c++/40764] -O3 gives wrong behaviour, no opt. OK

vielhaber at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Jul 15 11:43:00 GMT 2009



------- Comment #3 from vielhaber at gmail dot com  2009-07-15 11:43 -------
Created an attachment (id=18200)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18200&action=view)
The C++ source with comments.

Comments in lines 180 describe the erroneous behaviour.
Output line starting with 1356 and following has 
resB[1]=0 (wrong!) with -O3 , but maintains previous value
0x2178... without optimization, which is the correct behaviour.
lines 79 and 150 ff. concerning array ix_check must be commented out.


Comment in l. 150 gives another error, apparently overwriting the
array ix_check[100]. If this array is in use, both with and without -O3,
things are the same. I checked all indices and do not see the culprit.

Guess I will turn to a high-level language like F77 in the near future...


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40764



More information about the Gcc-bugs mailing list