re PR tree-optimization/33291 (a+=2; a+=2 not simplified to a+=4; with -O3 ...
[gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / 20030731-1.c
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fdump-tree-dom3" } */
3
4 extern void abort (void);
5
6 struct rtx_def;
7 typedef struct rtx_def *rtx;
8 struct rtvec_def;
9 typedef struct rtvec_def *rtvec;
10 union tree_node;
11 typedef union tree_node *tree;
12 struct rtx_def
13 {
14 int code;
15 int mode;
16 unsigned int in_struct:1;
17 };
18 struct tree_common
19 {
20 int code;
21 };
22 struct tree_decl
23 {
24 rtx rtl;
25 };
26 union tree_node
27 {
28 struct tree_common common;
29 struct tree_decl decl;
30 };
31 rtx
32 store_expr (exp, target, want_value)
33 tree exp;
34 rtx target;
35 int want_value;
36 {
37 if (exp->common.code == 42)
38 abort ();
39 else if (queued_subexp_p (target))
40 {
41 blah (target->mode);
42 if (target->code)
43 abort ();
44 }
45 else
46 {
47 if (target->code && (__extension__({target;})->in_struct));
48 }
49
50 if ((target != (exp->decl.rtl
51 ? (exp->decl.rtl
52 ? exp->decl.rtl
53 : (make_decl_rtl (exp, 0), exp->decl.rtl))
54 : 0))
55 && expr_size (exp))
56 ;
57 }
58
59 /* All paths to the test "target != 0" occuring in the final IF statement
60 dereference target. Thus target can not have the value zero at that
61 point and the test should have been eliminated. */
62 /* ??? The dominator walker (A) doesn't merge this data at joins and
63 (B) only looks at immediate dominators, and only queued_subexp_p
64 immediately dominates the comparison in question. We need something
65 stronger. */
66 /* { dg-final { scan-tree-dump-times "target.*!= 0" 0 "dom3" { xfail *-*-* } } } */
67 /* { dg-final { cleanup-tree-dump "dom3" } } */