https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92581
Bug ID: 92581
Summary: [10 Regression] condition chains vectorized wrongly
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: rguenth at gcc dot gnu.org
Target Milestone: ---
#define N 512
int a[N], b[N];
int __attribute__((noipa))
foo (int aval, int bval)
{
int i, res = 0;
for (i=0; i<N; i++)
{
if (a[i] != 0)
res = aval;
if (b[i] != 0)
res = bval;
}
return res;
}
int main()
{
check_vect ();
if (foo (1, 2) != 0)
abort ();
a[3] = 1;
b[4] = 1;
if (foo (1, 2) != 2)
abort ();
a[7] = 1;
if (foo (1, 2) != 1)
abort ();
return 0;
}
doesn't work correctly.