[Bug target/94852] -ffloat-store on x64 target
vanyacpp at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Apr 29 18:15:27 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94852
--- Comment #6 from Ivan Sorokin <vanyacpp at gmail dot com> ---
(In reply to Richard Biener from comment #1)
> @item -ffloat-store
> @opindex ffloat-store
> Do not store floating-point variables in registers, and inhibit other
> options that might change whether a floating-point value is taken from a
> register or memory.
>
> I think it does what it says?
This is a follow-up for my previous comment.
Perhaps I haven't explained myself properly, let me explain why I find the
existing behavior a bit confusing.
>From the documentation on -ffloat-store:
"This option prevents undesirable excess precision on machines such as the
68000 where the floating registers (of the 68881) keep more precision than a
double is supposed to have. Similarly for the x86 architecture."
When a person uses -ffloat-store the desired effect is not the additional
loads/stores, but the reproducible results across different compiler
version/optimization options. It just happened that the cheapest way to go so
is adding additional loads/stores.
I'm pretty sure most users would be in favor of removing extra loads/stores
when they don't affect the results.
I understand that perhaps there are reasons why -ffloat-store should work the
way it works now. If this is true, I would recommend updating the documentation
by reflecting the cases (if they exists) when one might want to use
-ffloat-store on x86-64. From what I understand now using -ffloat-store on
x86-64 is just a mistake.
More information about the Gcc-bugs
mailing list