[Bug rtl-optimization/93184] Incorrect result of right shift bit operation if compile-time constant shift amount exceeds type width

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 7 11:13:00 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93184

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Shifts by negative values or larger or equal to the bitsize are undefined
behavior.  Once you invoke undefined behavior in a program, there is no
discussion about what is correct and what is incorrect, the only incorrect
thing is the program that lead to the undefined behavior, any behavior at that
point is fine.


More information about the Gcc-bugs mailing list