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

Renato Golin via cfe-dev cfe-dev at lists.llvm.org
Wed Mar 15 09:35:00 PDT 2017


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:
>
> #pragma STDC FP_CONTRACT ON
> 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...


> 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


More information about the cfe-dev mailing list