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 tree-optimization/28777] Zerodetection (i != 0) compiled with -O2 don't work



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-08-21 05:03 -------
(In reply to comment #2)
> It is signed overflow being undefined and so the i == 0 test being optimized
> away.
> Use -fwrapv or an unsigned loop counter.

And the "!= 0" is being optimized to 1 because signed overflow is undefined.


-- 


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


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