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/48197] possible wrong code bug at -O0


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

--- Comment #2 from John Regehr <regehr at cs dot utah.edu> 2011-03-18 20:04:04 UTC ---
(In reply to comment #1)
>    x = (long)0 > ((unsigned int)0 ^ (signed short)0x8000);
>    x = (long)0 > ((unsigned)0 ^ (unsigned)0x8000);
> I think you missed something here (unsigned)(signed short) still sign extends.

Thanks Andrew, I'll look more closely.

If GCC is right, then Clang and Intel CC are wrong (assuming all three
compilers make the same implementation-dependent decisions for integers on
x86-64, which I was under the impression they did).


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