This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: floating point optimization by function
- From: Ian Lance Taylor <iant at google dot com>
- To: Simon West <simon dot west at cantab dot net>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 04 May 2011 16:58:08 -0700
- Subject: Re: floating point optimization by function
- References: <20110504234944.GA1000@simon-wests-ibook-g4.local>
Simon West <simon.west@cantab.net> writes:
> Could anyone tell me if there is a GCC equivalent of the pragmas used
> to control floating point arithmetic on a function-by-function basis
> in Microsoft Visual C++? (the pragmas are described here:
> http://msdn.microsoft.com/en-us/library/aa289157%28v=vs.71%29.aspx#floapoint_topic7
> )
>
> Specifically, I have a function for which I need to guarantee that no
> associative arithmetic optimizations are performed, i.e., I need to force
> -fno-associative-math to be used, but only around this particular function.
int f() __attribute__ ((optimize ("fno-associative-math")));
int f() { ... }
Ian