This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/37569] Loop incorrectly optimized to endless loop with -Os/-O2/-O3



------- Comment #4 from ppr at melexis dot com  2008-09-18 07:58 -------
The problem seems to be related with the i pointer reaching 0. If the loop
condition is e.g. "while ( i != 2 )" everything is ok.
The same if the "sum = sum + *(i)" is replaced e.g. with "sum = sum + *(i+1)"


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]