re PR tree-optimization/33291 (a+=2; a+=2 not simplified to a+=4; with -O3 ...
[gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr18133-2.c
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fdump-tree-optimized-blocks" } */
3
4 int c, d;
5
6 int
7 bar (int a)
8 {
9 void *p;
10 int b;
11
12 if (a!=0)
13 {
14 b = 3;
15 p = &&L0;
16 }
17 else
18 {
19 b = 5;
20 p = &&L1;
21 }
22
23 goto *p;
24
25 L0:
26 c = b;
27 return 1;
28
29 L1:
30 d = b;
31 return 0;
32 }
33
34 /* The both paths to the block containing the goto *p should
35 have been threaded, thus eliminating the need for the goto *p. */
36
37 /* { dg-final { scan-tree-dump-times "goto p" 0 "optimized" } } */
38
39 /* There should not be any abnormal edges as DOM removed the
40 computed goto. */
41
42 /* { dg-final { scan-tree-dump-times "ab" 0 "optimized" } } */
43 /* { dg-final { cleanup-tree-dump "optimized" } } */