[PATCH][BZ #5768 fix SIGFPE in isnan(0 for SNaN

Daniel Jacobowitz drow@false.org
Wed Feb 20 21:42:00 GMT 2008


On Tue, Feb 19, 2008 at 08:42:13AM -0600, Steven Munroe wrote:
> No its just the spread across several macros there is no good way to
> define a dependency to prevent this code motion from happening. In the
> sequence:
> 
>   savedstate = fegetenv_register ();
>   reset_fpscr_bit (FPSCR_VE);
>   result = !(x == x);
>   fesetenv_register (savedstate);
>   return result;
> 
> the fesetenv_register macro defines inline asm containing the mtfsf
> instruction. In this case the asm would need a dependency on "result"
> to prevent the code motion. I would have to replace the
> fesetenv_register macro with explicit inline asm or define a special
> version of fesetenv_register which passes an extra parm for the bogus
> dependency.
> 
> So this is not a GCC bug. It was just simpler to write the asm code and
> get exactly the code I want in the correct sequence.

I see that the example of volatile asms in the GCC manual is
specifically changing the rounding mode on PowerPC.  So GCC is
behaving as designed - you're right.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Libc-alpha mailing list