aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/reassoc-19.c
blob: bbaf69b40e2c8a67529db71cef6fc0d6f6e7fcab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* { dg-do compile } */
/* { dg-options "-Os -fdump-tree-optimized" } */

/* Slightly changed testcase from PR middle-end/40815.  */
void bar(char*, char*, int);
void foo(char* left, char* rite, int element)
{
  while (left <= rite)
  {
    /* This should expand into
       _7 = (sizetype) element_6(D);
       _8 = -_7;
       rite_9 = rite_1 + _8;  */
    rite -= element;
    bar(left, rite, element);
  }
}

/* { dg-final { scan-tree-dump-times "= \\\(sizetype\\\) element" 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times "= -" 1 "optimized" } } */
/* { dg-final { scan-tree-dump-times " \\\+ " 1 "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */