summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr51583.c
blob: 2c4ec4723c47e2a6873fae12e440fcab2aefb01a (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
/* { dg-do compile } */
/* { dg-options "-O1" } */

typedef __complex__ double Value;

union U
{
  Value v;
  char c[sizeof(Value)];
};

struct S
{
  union U u;
  int i,j;
};

Value gv;
int gi, gj;

Value foo (void)
{
  struct S s,t;

  t.i = gi;
  t.j = gj;
  t.u.v = gv;
  t.u.c[0] = 0;

  s = t;
  __imag__ s.u.v += s.i;

  return s.u.v;
}