summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr65533.c
blob: 49edf15c00e9587d35e3f54c1c2b1292af4ba2c8 (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
/* PR tree-optimization/65533 */
/* { dg-do compile } */
/* { dg-options "-Ofast -w" } */

struct A { int a[2]; };
struct B { double b[2]; };
struct C { double c[4][1]; };

static inline void
bar (struct B *x, double y, double z)
{
  x->b[0] = y;
  x->b[1] = z;
}

void baz (struct B *);

void
foo (struct C *x, struct A *y)
{
  struct B d;
  bar (&d, x->c[1][0] * y->a[0] + x->c[0][1] * y->a[1] + x->c[0][0] * x->c[0][1],
       x->c[0][0] * y->a[0] + x->c[0][1] * y->a[1] + x->c[0][1] * y->a[0] + x->c[0][0]);
  baz (&d);
}