This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/36923] Crashes with FPU inline-assembly
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Aug 2008 09:16:15 -0000
- Subject: [Bug target/36923] Crashes with FPU inline-assembly
- References: <bug-36923-16516@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from ubizjak at gmail dot com 2008-08-03 09:16 -------
Stack asm constraints have some annoying properties. Please note, that in your
testcase, value in %st1 isn't popped from the stack. Also, reverse subtract can
be used to avoid fxch. I propose to rewrite your function as:
static float fraction( float _x )
{
int tmp;
asm ( "fld %%st\n\t"
"fisttp %1\n\t"
"fild %1\n\t"
"fsubrp %%st, %%st(1)"
: "+t"( _x ), "=m"( tmp )
:
: "st(1)" );
return( _x );
}
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36923