https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71460

--- Comment #18 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to rguent...@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

Reply via email to