Re: [PATCH] middle-end, c++: Treat shifts by negative as undefined [PR96929]

2020-11-23 Thread Richard Biener
On Mon, 23 Nov 2020, Jakub Jelinek wrote: > Hi! > > The PR38359 change made the -1 >> x to -1 optimization less useful by > requiring that the x must be non-negative. > Shifts by negative amount are UB, but we for historic reasons had in some > (but not all) places some hack to treat shifts by

[PATCH] middle-end, c++: Treat shifts by negative as undefined [PR96929]

2020-11-23 Thread Jakub Jelinek via Gcc-patches
Hi! The PR38359 change made the -1 >> x to -1 optimization less useful by requiring that the x must be non-negative. Shifts by negative amount are UB, but we for historic reasons had in some (but not all) places some hack to treat shifts by negative value as the other direction shifts by the