OSDN Git Service

PR middle-end/20256
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / tree-ssa / 20030729-1.c
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fdump-tree-dom3" } */
3
4 extern void abort (void);
5 union tree_node;
6 typedef union tree_node *tree;
7
8
9 enum tree_code
10 {
11   SET_TYPE,
12   RECORD_TYPE,
13   LAST_AND_UNUSED_TREE_CODE
14 };
15 extern const char tree_code_type[];
16
17 struct tree_common
18 {
19
20   enum tree_code code:8;
21 };
22
23
24
25
26
27 union tree_node
28 {
29   struct tree_common common;
30 };
31
32 readonly_fields_p (type)
33      tree type;
34 {
35
36   if (type->common.code != RECORD_TYPE)
37     return;
38
39   if (tree_code_type[type->common.code] != 't')
40     abort ();
41
42   return;
43 }
44
45 /* A good optimizer would realize that the cast to (unsigned int) is
46    useless as the earlier cast of the same value of (unsigned char) will
47    always produce the same result.  */
48 /* { dg-final { scan-tree-dump-times "\\(unsigned int\\)" 0 "dom3"} } */
49  
50 /* There should be one load of ->common.code.  We currently fail this
51    because we load from ->common.code using different types.  */
52 /* { dg-final { scan-tree-dump-times "common\.code" 1 "dom3"} } */
53
54 /* { dg-final { cleanup-tree-dump "dom3" } } */