[Bug target/81906] [7/8 Regression] Calls to rint() wrongly optimized away starting in g++ 6
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Aug 21 11:11:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81906
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Target| |x86_64-*-*, i?86-*-*
Priority|P3 |P2
Component|c++ |target
Target Milestone|--- |7.3
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
rint () is inlined into an SSE sequence:
void
ix86_expand_rint (rtx operand0, rtx operand1)
{
/* C code for the stuff we're doing below:
xa = fabs (operand1);
if (!isless (xa, 2**52))
return operand1;
xa = xa + 2**52 - 2**52;
return copysign (xa, operand1);
*/
that doesn't work for rounding modes != to-nearest. Previously we had
the pattern guarded by !flag_trapping_math. Thus with GCC 6 the bug
persists with -frounding-math -fno-trapping-math.
For ! TARGET_ROUND we need to use ! flag_rounding_math (or fix the code
sequence in case there exists one that works).
More information about the Gcc-bugs
mailing list