1 /* PR c/70255 */
2 /* { dg-do compile } */
3
4 double
5 fn1 (double h, double l) /* { dg-message "previous definition" } */
6 {
7 return h + l;
8 }
9 double fn1 (double, double) __attribute__ ((optimize ("no-associative-math"))); /* { dg-warning "optimization attribute" } */
10
11 __attribute__ ((optimize ("no-associative-math"))) double
12 fn2 (double h, double l)
13 {
14 return h + l;
15 }
16 double fn2 (double, double) __attribute__ ((optimize ("no-associative-math")));
17
18 __attribute__ ((optimize ("no-associative-math"))) double
19 fn3 (double h, double l) /* { dg-message "previous definition" } */
20 {
21 return h + l;
22 }
23 double fn3 (double, double) __attribute__ ((optimize ("O2,no-associative-math"))); /* { dg-warning "optimization attribute" } */
24
25 __attribute__ ((optimize ("no-associative-math,O2"))) double
26 fn4 (double h, double l) /* { dg-message "previous definition" } */
27 {
28 return h + l;
29 }
30 double fn4 (double, double) __attribute__ ((optimize ("O2,no-associative-math"))); /* { dg-warning "optimization attribute" } */
31
32 __attribute__ ((optimize ("no-reciprocal-math"), optimize ("no-associative-math"))) int
33 fn5 (void)
34 {
35 return 0;
36 }
37 int __attribute__ ((optimize ("no-associative-math"), optimize ("no-reciprocal-math"))) fn5 (void);