This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/48295] Incorrect code generated with dynamic floating point rounding mode switches
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 28 Mar 2011 10:50:53 +0000
- Subject: [Bug tree-optimization/48295] Incorrect code generated with dynamic floating point rounding mode switches
- Auto-submitted: auto-generated
- References: <bug-48295-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48295
--- Comment #4 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2011-03-28 10:50:44 UTC ---
On Mon, 28 Mar 2011, rguenth at gcc dot gnu.org wrote:
> Btw, your testcase would be kindof invalid as you are not using the
> documented standard way of accessing fenv but using inline-asm (and
> we don't have a special clobber that tells GCC you touched the FP
> control word).
You mark the asm as reading and clobbering fpcr - that register name
already exists in GCC, and it's a bug that glibc's fpu_control.h doesn't
use it, though I suppose you'd need to add the "mxcsr" name as well.
When -frounding-math is actually properly implemented it ought to be
taught about target-specific registers representing rounding modes (and
likewise exception status) so it knows how asms interact with the
floating-point state. (Non-const, non-pure function calls will also need
to be presumed to interact with the state in unknown ways since they may
end up calling fenv.h functions.)