libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr82436.c
blob4129e15447f8b318679a1b48e8dcfac6f2925cc2
1 /* { dg-do compile } */
2 /* { dg-additional-options "-Ofast -fno-tree-scev-cprop" } */
3 /* { dg-additional-options "-mavx2" { target { x86_64-*-* i?86-*-* } } } */
5 struct reflection_type
7 int h;
8 int k;
9 int l;
10 double f_exp;
11 double f_sigma;
12 _Complex double f_calc;
13 double f_pred;
14 double i_exp;
15 double i_sigma;
16 double i_pred;
19 double y, w;
20 int foo (struct reflection_type *r, int n, unsigned s)
22 int i;
23 y = 0;
24 w = 0;
25 for (i = 1; i < n; ++i)
27 struct reflection_type *x = &r[i*s];
28 double fpred = x->f_pred;
29 double fexp = x->f_exp;
30 double tem = (fpred - fexp);
31 y += __builtin_fabs (tem / x->f_sigma);
32 w += __builtin_fabs (tem / fexp);
34 return i;