[cfe-dev] fp-contract at -O0

Stephen Canon via cfe-dev cfe-dev at lists.llvm.org
Tue Feb 18 11:03:05 PST 2020



> On Feb 18, 2020, at 2:01 PM, David Greene <greened at obbligato.org> wrote:
> 
> Stephen Canon via cfe-dev <cfe-dev at lists.llvm.org> writes:
> 
>> If anything, preserving FMA formation at O0 _helps_ debuggability,
>> because it means that numerical behavior is more likely to match what
>> a user observed at Os, allowing them to debug the problem.
> 
> The user can always pass -ffp-contract=on to do that.
> 
> There are many cases where FMA is not desired and most users don't
> expect fused operations at -O0 unless they specifically ask for it.

If FMA is not desired, -ffp-contract=off or the pragma should be used to disable it. -O0 is the wrong tool for that job.

– Steve


More information about the cfe-dev mailing list