aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/pr59924.c
blob: 1d8d52fb0796e39718b39747f8ef6fc59880112a (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
/* PR tree-optimization/59924 */
/* { dg-do compile } */
/* { dg-options "-O1 -Wall" } */

struct S { struct T *a; double b; struct S *c; };
struct T { struct S *d; };
extern void bar (double);

void
foo (struct S * x, int y, int z, int w)
{
  int e;
  struct S *f;
  for (f = x->a->d; f; f = f->c)
    {
      if (5 < w)
	{
	  e = -w;
	  z = w;
	}
    }
  if (y != 0 || z != 0)
    {
      double g = x->b + (double) e * (double) y; /* { dg-warning "may be used uninitialized in this function" } */
      bar (g * g);
    }
}