summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-3.c
blob: d2a1fbb436a1b07d21216022c2a4bee2a9d1a890 (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
46
47
48
49
/* { dg-do compile } */ 
/* { dg-options "-O2 -fdump-tree-dom1-details -fno-short-enums" } */

extern void abort (void) __attribute__ ((__noreturn__));
union tree_node;
typedef union tree_node *tree;
enum tree_code
{
  VAR_DECL,
  SSA_NAME,
  MAX_TREE_CODES
};
extern unsigned char tree_contains_struct[MAX_TREE_CODES][64];
struct tree_base
{
  enum tree_code code:16;
};
enum tree_node_structure_enum
{
  TS_DECL_COMMON
};
struct tree_ssa_name
{
  tree var;
};
union tree_node
{
  struct tree_base base;
  struct tree_ssa_name ssa_name;
};
long
expand_one_var (tree var, unsigned char toplevel, unsigned char really_expand)
{
  tree origvar = var;
  var = var->ssa_name.var;
  if (((enum tree_code) (origvar)->base.code) == SSA_NAME
      && !((var->base.code != VAR_DECL)))
    abort ();
  if ((var->base.code) != VAR_DECL && ((origvar)->base.code) != SSA_NAME)
    ;
  else if (tree_contains_struct[(var->base.code)][(TS_DECL_COMMON)] != 1)
    abort ();
}
/* We should thread the jump, through an intermediate block.  */
/* { dg-final { scan-tree-dump-times "Threaded" 1 "dom1"} } */
/* { dg-final { scan-tree-dump-times "Registering jump thread .through joiner block.: \\(.*\\);  \\(.*\\);  \\(.*\\);" 1 "dom1"} } */

/* { dg-final { cleanup-tree-dump "dom1" } } */