[Bug tree-optimization/106884] ifcombine may move shift so it shifts more than bitwidth

2023-11-01 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106884 --- Comment #7 from Andrew Pinski --- PR 111000 was similar one but for LIM.

[Bug tree-optimization/106884] ifcombine may move shift so it shifts more than bitwidth

2023-08-05 Thread kristerw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106884 --- Comment #6 from Krister Walfridsson --- One more similar case (that may be the same as comment #3): int g; void foo(int a, int b, int c, int d, int e) { if ((10 + a) * b) { g = (c || (g >> d)) << 1; } } In this case,

[Bug tree-optimization/106884] ifcombine may move shift so it shifts more than bitwidth

2023-07-11 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106884 --- Comment #5 from Andrew Pinski --- (In reply to Richard Biener from comment #4) > But yes, since we now unconditionally compute 1< GCC could assume b is in range. We are lacking a way to compute 1< optimally without that undefined behavior.

[Bug tree-optimization/106884] ifcombine may move shift so it shifts more than bitwidth

2023-07-11 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106884 --- Comment #4 from Richard Biener --- To clarify for the original testcase, ifcombine combines the two bit tests (x & (1<

[Bug tree-optimization/106884] ifcombine may move shift so it shifts more than bitwidth

2022-09-30 Thread kristerw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106884 --- Comment #3 from Krister Walfridsson --- A similar case is int r1, r2; int foo(int a, int s1, int s2) { if (a & (1 << s1)) return r1; if (a & (1 << s2)) return r1; return r2; } where reassoc2 optimizes this to always shift

[Bug tree-optimization/106884] ifcombine may move shift so it shifts more than bitwidth

2022-09-08 Thread kristerw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106884 --- Comment #2 from Krister Walfridsson --- This optimization is invalid if (int)1 << 33 is _not_ undefined behavior in GIMPLE! Consider an architecture where (int)1 << 33 evaluates to 0. foo(2, 1, 33) evaluates to 0 for the original GIMPLE,

[Bug tree-optimization/106884] ifcombine may move shift so it shifts more than bitwidth

2022-09-08 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106884 Richard Biener changed: What|Removed |Added CC||rguenth at gcc dot gnu.org