Merge from mainline
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / loadpre10.c
blob4147a702ae41716047f7333c07d9d9c4364deeb2
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-pre-stats" } */
3 struct tree_common
4 {
5 int code;
6 };
7 union tree_node
8 {
9 struct tree_common common;
10 };
11 typedef union tree_node *tree;
13 extern tree test (tree, int, int);
14 extern tree foo (void);
15 extern void abort (void) __attribute__ ((__noreturn__));
17 /* Redundant loads of expr->common.code */
18 tree
19 test (tree expr, int t, int D17630)
21 int __i;
23 L0:
24 if (expr->common.code != 142) goto L23; else goto L2;
26 L2:
27 __i = 0;
28 goto L10;
30 L10:
31 __i = __i + 1;
32 if (D17630 != __i) goto L8; else goto L19;
34 L8:
35 if (t) goto L15; else goto L10;
37 L15:
38 expr = foo ();
39 if (expr->common.code != 142) goto L23; else goto L0;
41 L19:
42 abort ();
44 L23:
45 return expr;
47 /* { dg-final { scan-tree-dump-times "Eliminated: 1" 1 "pre"} } */
48 /* { dg-final { cleanup-tree-dump "pre" } } */