This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/81906] [7/8 Regression] Calls to rint() wrongly optimized away starting in g++ 6
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 21 Aug 2017 09:46:51 +0000
- Subject: [Bug target/81906] [7/8 Regression] Calls to rint() wrongly optimized away starting in g++ 6
- Auto-submitted: auto-generated
- References: <bug-81906-4@http.gcc.gnu.org/bugzilla/>
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).