[Bug target/71460] Copying structs can trap (on x86-32) due to SNaN to QNaN
ubizjak at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Jun 10 07:25:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71460
--- Comment #18 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to rguenther@suse.de from comment #17)
> But this also hints at the ABI for
>
> void foo (union U { int x; float y; });
>
> changing with the patch, no? Or ultimatively at the FE using a bogus
> check to verify ABI compatibility (just looking at TYPE_MODE).
No, there is no ABI violation. The testcase:
--cut here--
union U { int x; float y; };
void foo (union U);
void test (void)
{
union U t;
t.y = 1.0f;
foo (t);
t.x = 1;
foo (t);
}
--cut here--
results in (-O2 -mfpmath=387 -m32):
pushl $1065353216
call foo
movl $1, (%esp)
call foo
The asm is also correct with -mregparm=1:
movl $1065353216, %eax
call foo
movl $1, %eax
call foo
More information about the Gcc-bugs
mailing list