aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr81245.c
blob: b2ee7bb3a9bf09194cee0db4f1562f94484f8e18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-options "-ffast-math" } */
/* { dg-do compile } */
/* This test used to crash the vectorizer as the ifconvert pass
   used to convert the if to copysign but called update_stmt on
   the old statement after calling fold_stmt. */
double sg[18];
void f(void)
{
  for (int i = 0 ;i < 18;i++)
  {
    if (sg[i] < 0.0)
      sg[i] = -1.0;
    else
      sg[i] = 1.0;
  }
}