summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/20011219-2.c
blob: 2ad7eb1a372f3bfa0ccff5ecd6c569e927f472d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* This testcase failed on Alpha at -O2 when simplifying conditional
   expressions.  */

struct S {
  unsigned long a;
  double b, c;
};

extern double bar (double, double);

int
foo (unsigned long x, unsigned int y, struct S *z)
{
  unsigned int a = z->a;
  int b = y / z->a > 1 ? y / z->a : 1;

  a = y / b < z->a ? y / b : z->a;
  z->c = z->b * bar ((double) a, (double) x);
  return 0;
}