OSDN Git Service

PR middle-end/40815
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / tree-ssa / reassoc-19.c
1 /* { dg-do compile } */
2 /* { dg-options "-Os -fdump-tree-reassoc2" } */
3
4 /* Slightly changed testcase from PR middle-end/40815.  */
5 void bar(char*, char*, int);
6 void foo(char* left, char* rite, int element)
7 {
8   while (left <= rite)
9   {
10     /* This should expand into
11        D.zzzz = D.zzzz - D.xxxx;
12        and NOT to
13        D.D.yyyy = -D.xxxx; D.zzzz = D.zzzz + D.yyyy;  */
14     rite -= element;
15     bar(left, rite, element);
16   }
17 }
18
19 /* There should be no " + " in the dump.  */
20 /* { dg-final { scan-tree-dump-times " \\\+ " 0 "reassoc2" } } */
21 /* { dg-final { cleanup-tree-dump "reassoc2" } } */