1 // PR target/70245
2 // { dg-do run }
3 // { dg-additional-sources "pr70245-aux.cc" }
4 // { dg-options "-O2" }
5 // { dg-additional-options "-fPIC" { target fpic } }
6 // { dg-additional-options "-march=i386 -mtune=atom" { target ia32 } }
7 
8 #include "pr70245.h"
9 
10 struct A *a, *i;
11 int b, c, e, l;
12 F d;
13 
14 static A *
foo(B * x,int * y,int * z)15 foo (B *x, int *y, int *z)
16 {
17   unsigned char *f = (unsigned char *) fn3 (y);
18   D *g = (D *) f;
19   A *h;
20   if (e || a || c || b || g->d)
21     return 0;
22   h = (A *) fn4 ();
23   __builtin_memcpy (h, a, sizeof (A));
24   h->a1 = *(D *) f;
25   if (d)
26     {
27       d (h, x, f + g->d, z);
28       if (*z)
29 	fn2 ();
30     }
31   return h;
32 }
33 
34 static A *
bar(B * x,int * y)35 bar (B *x, int *y)
36 {
37   int *j = fn1 (x->b, y);
38   if (*y > 0)
39     return 0;
40   i = foo (x, j, y);
41   return i;
42 }
43 
44 B k;
45 
46 void
baz(int x)47 baz (int x)
48 {
49   if (x)
50     bar (0, 0);
51   bar (&k, &l);
52 }
53