[Bug tree-optimization/119780] [13/14/15 regression] wrong code at -O{1,s} : runtime hang since r13-3688
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119780
--- Comment #4 from Jakub Jelinek ---
Slightly cleaned up & simplified:
int a = 1, b = -__INT_MAX__, c;
int
main ()
{
goto d;
e:
a = 0;
f:
if (a + c <= 0)
goto g;
h:
goto i;
d:
if (b >= 0)
goto e;
goto j;
i:
if (c - __INT_MAX__ * a >= 0)
goto h;
goto d;
j:
b = 7;
goto f;
g:;
}
The slrs change is
[local count: 118111600]:
- _12 = a_lsm.8_15 * -2147483647;
- _13 = c.1_2 + _12;
+ slsr_7 = a_lsm.8_15 * -2147483648;
+ _13 = _3 - slsr_7;
if (_13 >= 0)
goto ; [0.00%]
else
where _3 is
_3 = c.1_2 + a_lsm.8_15;
c.1_2 is 1, a_lsm.8_15 is 1, so before slsr this is 1 + (1 * -2147483647) which
is
well defined -2147483646, while after that change it is 2 - (1 * -2147483648),
which is UB.
[Bug tree-optimization/119780] [13/14/15 regression] wrong code at -O{1,s} : runtime hang since r13-3688
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119780 Richard Biener changed: What|Removed |Added Last reconfirmed||2025-04-14 Priority|P3 |P2 Status|UNCONFIRMED |NEW Ever confirmed|0 |1
[Bug tree-optimization/119780] [13/14/15 regression] wrong code at -O{1,s} : runtime hang since r13-3688
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119780 Andrew Pinski changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill ||a/show_bug.cgi?id=106883 --- Comment #3 from Andrew Pinski --- (In reply to Sam James from comment #2) > -fno-tree-slsr works Then maybe PR 106883.
[Bug tree-optimization/119780] [13/14/15 regression] wrong code at -O{1,s} : runtime hang since r13-3688
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119780 --- Comment #2 from Sam James --- -fno-tree-slsr works
[Bug tree-optimization/119780] [13/14/15 regression] wrong code at -O{1,s} : runtime hang since r13-3688
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119780
Sam James changed:
What|Removed |Added
Summary|[13/14/15 regression] wrong |[13/14/15 regression] wrong
|code at -O{1,s} : runtime |code at -O{1,s} : runtime
|hang|hang since r13-3688
Keywords|needs-bisection |
CC||aldyh at gcc dot gnu.org,
||amacleod at redhat dot com
--- Comment #1 from Sam James ---
r13-3688-g679be32e66428f
