[Bug target/71486] Transparent union doesn't work with long double for x86_64
ubizjak at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Jun 10 09:46:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71486
--- Comment #2 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Richard Biener from comment #1)
> I thought the ABI for transparent unions was that of passing its members.
>
> But int128 and long double are passed differently.
Similar case compiles OK (value in int reg vs. value in XMM reg):
--cut here--
union U { long x; double y; } __attribute__ ((transparent_union));
void foo (union U);
void test (void)
{
union U t;
foo (1.0);
foo (1L);
}
--cut here--
-O2:
movabsq $4607182418800017408, %rdi
call foo
movl $1, %edi
call foo
and even following for 32bit target, value in int reg vs. memory:
--cut here--
union U { int x; float y; } __attribute__ ((transparent_union));
void foo (union U);
void test (void)
{
union U t;
foo (1.0f);
foo (1);
}
--cut here--
-O2 -m32 -mregparm=1:
movl $1065353216, %eax
call foo
movl $1, %eax
call foo
More information about the Gcc-bugs
mailing list