aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/isolate-3.c
blob: 7dddd8062c0e9309631ba28af5aebec7c57d2516 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* { dg-do compile } */ 
/* { dg-options "-O2 -fdump-tree-isolate-paths" } */


typedef long unsigned int size_t;
extern void *memset (void *__s, int __c, size_t __n)
  __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__nonnull__ (1)));
struct rtx_def;
typedef struct rtx_def *rtx;
typedef struct VEC_rtx_base

{
  unsigned num;
  unsigned alloc;
  rtx vec[1];
} VEC_rtx_base;
static __inline__ rtx *
VEC_rtx_base_address (VEC_rtx_base * vec_)
{
  return vec_ ? vec_->vec : 0;
}
typedef struct VEC_rtx_gc
{
  VEC_rtx_base base;
} VEC_rtx_gc;

static __inline__ void
VEC_rtx_gc_safe_grow (VEC_rtx_gc ** vec_, int size_, const char *file_,
                      unsigned line_, const char *function_)
{
  ((*vec_) ? &(*vec_)->base : 0)->num = size_;
} 

static __inline__ void
VEC_rtx_gc_safe_grow_cleared (VEC_rtx_gc ** vec_, int size_,
                              const char *file_, unsigned line_,
                              const char *function_, int oldsize)
{
  VEC_rtx_gc_safe_grow (vec_, size_, file_, line_, function_);
  memset (&(VEC_rtx_base_address ((*vec_) ? &(*vec_)->base : 0))[oldsize], 0,
          sizeof (rtx) * (size_ - oldsize));
}

static VEC_rtx_gc *reg_base_value;
void
init_alias_analysis (void)
{
  unsigned int maxreg = max_reg_num ();
  (VEC_rtx_gc_safe_grow_cleared
   (&(reg_base_value), maxreg, "../../../gcc-4.6.0/gcc/alias.c", 2755,
    __FUNCTION__, arf ()));
}



/* This is an example of how a NULL pointer dereference can show up
   without a PHI.  Note VEC_rtx_gcc_safe_grow.  If an earlier pass
   (such as VRP) isolates the NULL path for some reason or another
   we end up with an explicit NULL dereference in the IL.  Yes, it
   started with a PHI, but by the time the path isolation code runs
   its explicit in the IL.  */
/* { dg-final { scan-tree-dump-times "__builtin_trap" 1 "isolate-paths"} } */
/* { dg-final { cleanup-tree-dump "isolate-paths" } } */