hppa: Fix pr110279-1.c on hppa
[official-gcc.git] / gcc / testsuite / gcc.dg / pr110279-1.c
bloba62acb734c6eeb200ef837b6218eb9b8b874444e
1 /* { dg-do compile } */
2 /* { dg-options "-Ofast --param avoid-fma-max-bits=512 --param tree-reassoc-width=4 -fdump-tree-widening_mul-details" } */
3 /* { dg-additional-options "-march=armv8.2-a" { target aarch64-*-* } } */
4 /* { dg-additional-options "-march=2.0" { target hppa*-*-* } } */
6 #define LOOP_COUNT 800000000
7 typedef double data_e;
9 /* Check that FMAs with backedge dependency are avoided. Otherwise there won't
10 be FMA generated with "--param avoid-fma-max-bits=512". */
12 data_e
13 foo1 (data_e a, data_e b, data_e c, data_e d)
15 data_e result = 0;
17 for (int ic = 0; ic < LOOP_COUNT; ic++)
19 result += (a * b + c * d);
21 a -= 0.1;
22 b += 0.9;
23 c *= 1.02;
24 d *= 0.61;
27 return result;
30 data_e
31 foo2 (data_e a, data_e b, data_e c, data_e d)
33 data_e result = 0;
35 for (int ic = 0; ic < LOOP_COUNT; ic++)
37 result = a * b + result + c * d;
39 a -= 0.1;
40 b += 0.9;
41 c *= 1.02;
42 d *= 0.61;
45 return result;
48 data_e
49 foo3 (data_e a, data_e b, data_e c, data_e d)
51 data_e result = 0;
53 for (int ic = 0; ic < LOOP_COUNT; ic++)
55 result = result + a * b + c * d;
57 a -= 0.1;
58 b += 0.9;
59 c *= 1.02;
60 d *= 0.61;
63 return result;
66 /* { dg-final { scan-tree-dump-times "Generated FMA" 3 "widening_mul"} } */