This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/84190] [7 Regression] double arithmetic on x86 no longer rounds to nearest
- From: "bruno at clisp dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 04 Feb 2018 16:16:59 +0000
- Subject: [Bug c/84190] [7 Regression] double arithmetic on x86 no longer rounds to nearest
- Auto-submitted: auto-generated
- References: <bug-84190-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84190
--- Comment #5 from Bruno Haible <bruno at clisp dot org> ---
(In reply to joseph@codesourcery.com from comment #4)
> You need to use -fexcess-precision=standard (or -msse2 -mfpmath=sse) for
> predictable results from double arithmetic on 32-bit x86. If you do that,
> do you still see such a problem?
If I pass -fexcess-precision=standard or -mfpmath=sse (no need for -msse2 in
this case), the test passes.
However, something has evidently changed (regressed) in the inliner: 'volatile
double', put in sufficiently many places, has the same effect as
-fexcess-precision=standard (before gcc 7 and in gcc 7). What has changed, is
that if I have 'volatile double' only in the signature of the 'equalfn'
function that gets inlined, since gcc 7 this information that the values should
be passed as IEEE doubles (discarding excess precision) gets lost.