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: "amonakov 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 14:51:55 +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
Alexander Monakov <amonakov at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amonakov at gcc dot gnu.org
--- Comment #12 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
[my comment collided with Joseph's, I'm pointing out that one additional
copysign is sufficient under -frounding-math)
I think this expansion works as intended for to-nearest and towards-zero
rounding modes, and swaps upwards and downwards rounding for negative operands.
Which implies that under -frounding-math the approach is fixable by swapping
signs of the 2**52 operands:
xa = fabs (operand1);
a2_52 = 2**52;
[if flag_rounding_math]
a2_52 = copysign (a2_52, operand1);
xa = xa + a2_52 - a2_52;
return copysign (xa, operand1);