summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c
blob: 170526547d2170fb0ffaf307f49d6d5f9bafc787 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom2" } */

extern void abort (void);
union tree_node;
typedef union tree_node *tree;
enum tree_code
{
  LAST_AND_UNUSED_TREE_CODE
};
extern const char tree_code_type[];
struct tree_common
{
  enum tree_code code:8;
};
struct tree_type
{
  double alias_set;
};
union tree_node
{
  struct tree_common common;
  struct tree_type type;
};
long
foo (t, set)
     tree t;
     double set;
{
  if (tree_code_type[t->common.code] != 't')
    abort ();

  t->type.alias_set = set;

  if (t->common.code == 42)
    return 1;
  else
    return 0;
}
/* There should be precisely one load of common.code.  If there is
   more than one, then the dominator optimizations failed.  */
/* ??? Will fail until we properly distinguish member stores.  At
   present the write to type.alias_set kills the previous load.  */
/* { dg-final { scan-tree-dump-times "common.code" 1 "dom2" { xfail *-*-* } } } */
/* { dg-final { cleanup-tree-dump "dom2" } } */