This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/49257] -mfpmath=sse generates x87 instructions on 32 bits OS
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 7 Jun 2011 08:39:33 +0000
- Subject: [Bug target/49257] -mfpmath=sse generates x87 instructions on 32 bits OS
- Auto-submitted: auto-generated
- References: <bug-49257-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49257
--- Comment #11 from Uros Bizjak <ubizjak at gmail dot com> 2011-06-07 08:38:45 UTC ---
Patched gcc fails following testcase:
--cut here--
#include <stdio.h>
float
__attribute__((noinline))
ll2f (long long i)
{
return i;
}
long long
__attribute__((noinline))
f2ll (float f)
{
return f;
}
int main ()
{
static volatile long long ll = 0x4000004000000001ll;
static volatile float f;
static volatile long long o;
f = ll2f (ll);
o = f2ll (f);
printf ("%#llx %f %#llx\n", ll, f, o);
return 0;
}
--cut here--
gcc -m32 -O2 -msse2 -mfpmath=sse:
0x4000004000000001 4611686018427387904.000000 0x4000000000000000
gcc -m32 -O2 -msse2 -mfpmath=387:
0x4000004000000001 4611686568183201792.000000 0x4000008000000000
A bit has been lost...