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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
I agree that -fwrapv should make left-shift of positive values when the result
is not representable well-defined but I'm not sure about the negative value
case - the standard does not provide enough reasoning to suggest the
undefinedness is because of actual overflow - in fact the standard allows E1 <<
0 and there's
definitely no overflow for negative E1 in that case.  Supposedly the
standard simply chickened out for non-twos-complement archs here again
and unfortunately didn't leave the door open for implementation-defined
behavior.

I suppose you are asking for an option to turn all left shifts into logical
shifts?

Reply via email to