re PR tree-optimization/33291 (a+=2; a+=2 not simplified to a+=4; with -O3 ...
[gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / 20030807-1.c
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fdump-tree-dom3" } */
3
4 struct rtx_def;
5 typedef struct rtx_def *rtx;
6
7
8
9 union rtunion_def
10 {
11 int rtint;
12 };
13 typedef union rtunion_def rtunion;
14
15
16
17 struct rtx_def
18 {
19 rtunion fld[1];
20
21 };
22
23 static int *uid_cuid;
24 static int max_uid_cuid;
25
26 rtx
27 bar (rtx r)
28 {
29 rtx place = r;
30
31 if (place->fld[0].rtint <= max_uid_cuid
32 && (place->fld[0].rtint > max_uid_cuid ? insn_cuid (place) :
33 uid_cuid[place->fld[0].rtint]))
34 return r;
35
36 return 0;
37 }
38
39 /* There should be two IF conditionals. One tests <= max_uid_cuid, the
40 other tets the value in uid_cuid. If either is false the jumps
41 are threaded to the return 0. Which in turn means the path
42 which combines the result of those two tests into a new test
43 must always be true and it is optimized appropriately. */
44 /* { dg-final { scan-tree-dump-times "if " 2 "dom3"} } */
45 /* { dg-final { cleanup-tree-dump "dom3" } } */