annotate gcc/testsuite/gcc.dg/tree-ssa/loop-5.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* A test for induction variable merging. */
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 /* { dg-do compile } */
kono
parents:
diff changeset
4 /* { dg-options "-O1 -fdump-tree-optimized" } */
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 void foo(long);
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 void xxx(void)
kono
parents:
diff changeset
9 {
kono
parents:
diff changeset
10 long iter, jter;
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 for (iter = 0, jter = 2; iter < 100; iter++, jter++)
kono
parents:
diff changeset
13 {
kono
parents:
diff changeset
14 foo (iter);
kono
parents:
diff changeset
15 foo (jter);
kono
parents:
diff changeset
16 }
kono
parents:
diff changeset
17 }
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 /* Only iter variable should remain. */
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 /* { dg-final { scan-tree-dump-times "int jiter" 0 "optimized" } } */
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 /* And jter shouldn't be an induction variable anymore (no PHI node). */
kono
parents:
diff changeset
24 /* { dg-final { scan-tree-dump-times "jter_\[0-9\]* = PHI" 0 "optimized" } } */
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 /* And the use of jter should be replaced by iter + 2 */
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 /* { dg-final { scan-tree-dump-times " \\+ 2" 1 "optimized" } } */
kono
parents:
diff changeset
29