1 /* PR tree-optimization/67815 */
2 /* { dg-do compile } */
3 /* { dg-options "-Ofast -g -fdump-tree-reassoc1-details" } */
5 extern float barf (float, float);
6 extern double bar (double, double);
11 return 7.5 * __builtin_copysignf (2.0, x
);
17 return -7.5 * __builtin_copysignf (2.0, x
);
21 f2 (double x
, double y
)
23 return x
* ((1.0/12) * __builtin_copysign (1.0, y
));
27 f3 (double x
, double y
)
29 return (x
* (-1.0/12)) * __builtin_copysign (1.0, y
);
33 f4 (double x
, double y
, double z
)
35 return (x
* z
) * ((1.0/12) * __builtin_copysign (4.0, y
));
39 f5 (double x
, double y
, double z
)
41 return (x
* (-1.0/12)) * z
* __builtin_copysign (2.0, y
);
47 return 7.5f
* y
* __builtin_copysignf (2.0f
, x
);
53 return -7.5f
* y
* __builtin_copysignf (2.0f
, x
);
60 float tmp2
= __builtin_copysignf (2.0f
, x
);
68 double tmp2
= __builtin_copysign (2.0, x
);
76 float tmp2
= __builtin_copysignf (2.0f
, x
);
77 float tmp3
= tmp2
* 24.0f
;
85 double tmp2
= __builtin_copysign (2.0, x
);
86 double tmp3
= tmp2
* 24.0;
94 float tmp2
= __builtin_copysignf (2.0f
, x
);
95 /* Can't reassoc here. */
96 return barf (tmp1
* tmp2
, tmp2
);
103 double tmp2
= __builtin_copysign (2.0, x
);
104 /* Can't reassoc here. */
105 return bar (tmp1
* tmp2
, tmp2
);
107 /* { dg-final { scan-tree-dump-times "Optimizing copysign" 12 "reassoc1"} }*/