summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/reassoc-23.c
blob: a5451ade6ef37fafdfe99d33bd50da13c75b5dbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do compile } */ 
/* { dg-options "-O2 -fdump-tree-reassoc1" } */

unsigned int
foo(unsigned int a, unsigned int b, unsigned int c, unsigned int d,
    unsigned int e, unsigned int f, unsigned int g, unsigned int h)
{
  /* Should be transformed into e = 20 */
  unsigned int i = (a + 9);
  unsigned int j = (-c + 1);
  i += (c + 8);
  j += (-a + 2);
  e = i + j;
  return e;
}

/* { dg-final { scan-tree-dump-times "= 20" 1 "reassoc1"} } */