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/45831] 0 = 10 (with -O0, 0 = 0 with -O1, but 10 = 10 expected)


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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> 2010-09-29 14:59:22 UTC ---
(In reply to comment #4)
> In case you are missing the point, most non-bug posters compile on their target
> machine.

In C/C++, shifting by a negative number is undefined.  So what that means is
that it could produce a different values on different targets and at different
times (including at different optimization level).  I think we warn with either
-Wextra or -Wall when we see a negative shifting count.


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