[cfe-dev] [RFC] FP Contract = fast?

Hal Finkel via cfe-dev cfe-dev at lists.llvm.org
Wed Mar 15 09:58:27 PDT 2017

On 03/15/2017 11:35 AM, Renato Golin wrote:
> On 15 March 2017 at 14:58, Hal Finkel <hfinkel at anl.gov> wrote:
>> When you reverted  r282259 in 282289, you also reverted the functional fix
>> to make the command-line option actually work. Right now it is broken.
>> Regardless of what else we do, we should fix this (we should probably
>> recommit r282259, with the default flipped, to pick up the fixes).
> We should run check-all and the test-suite with it on/fast before
> flipping the switch, and make sure that the behaviour Sebastian
> encountered is dealt with before this going live, or we'd be breaking
> too many test-suites and reverting and reapplying too often.
> But I'm certainly in favour of the plan to make it on/fast by default.
>> If you were to change your source file to:
>> int foo(float a, float b, float c) { return a*b+c; }
> I wasn't aware you needed the pragma for -ffp-contract=on. I assumed
> it would enable on all fp-math that the standard allowed (thus maybe
> needing some annotation on the operations).
> I thought that the pragma was to avoid using the command line argument...

You shouldn't; this is a bug.


>> I'm certainly in favor of this plan. My users generally find our current
>> defaults confusing because it differs from all of our other compilers (GCC
>> and vendor compilers), plus it gives poor performance.
> Right, I also agree to follow the principle of least surprise, we
> should default to "fast". Let's just make sure the infrastructure
> isn't going to crumble and do it.
> cheers,
> --renato

Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory

More information about the cfe-dev mailing list