https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78559
Bug ID: 78559
Summary: [7 Regression] wrong code due to tree if-conversion?
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: ktkachov at gcc dot gnu.org
Target Milestone: ---
The testcase:
int g = 20;
int d = 0;
short
fn2 (int p1, int p2)
{
return p2 >= 2 || 5 >> p2 ? p1 : p1 << p2;
}
int
main ()
{
int result = 0;
lbl_2582:
if (g)
{
for (int c = -3; c; c++)
result = fn2 (1, g);
}
else
{
for (int i = 0; i < 2; i += 2)
if (d)
goto lbl_2582;
}
if (result != 1)
__builtin_abort ();
return 0;
}
used to (erroneously) abort on aarch64-none-linux-gnu with -O3 after r235808
but stopped aborting with r242550. It still passes after the fix r242689 but
I'm not sure if the bug has just gone latent.
To reproduce on aarch64 you'll have to revert r242689 and r242550.