This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/60578] wrong code (that hangs) at -O0 on x86_64-linux-gnu (affecting all gcc versions)
- From: "su at cs dot ucdavis.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 19 Mar 2014 06:09:41 +0000
- Subject: [Bug c/60578] wrong code (that hangs) at -O0 on x86_64-linux-gnu (affecting all gcc versions)
- Auto-submitted: auto-generated
- References: <bug-60578-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60578
--- Comment #3 from Zhendong Su <su at cs dot ucdavis.edu> ---
> (because (c ^ 0L) < -1 is true in 64-bit, so the code returns)
Or perhaps not, as -1 should actually be promoted to signed long, so the
comparison becomes 0L < -1L, and is thus false and triggers the undefined
behavior?