summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/20030907-2.c
blob: 47d60946e0cc83a373d23e1c03849f488c35c323 (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
/* PR optimization/12109

   This would ICE in tree-ssa-dce.c:process_worklist() when
   the function was expecting an SSA_NAME but found a VAR_DECL.  */

/* { dg-do compile } */
/* { dg-options "-O -ftree-dce" } */

void *do_it(void * dest, const void * src);
double *create_float(void);

void parse_rvalue(void **DataPtr)
{
  double local = 0.0;
  int terms = 1;

  *DataPtr = create_float();
  
  switch (terms)
    {
    case 1:
      *((double *)*DataPtr) = local;
      break;
      
    case 2:
      do_it(*DataPtr, &local);
      break;
    }
}