On 12/21/2017 01:38 PM, Jakub Jelinek wrote:
> Hi!
> 
> When we don't pass an argument at all because it is TYPE_EMPTY_P, we
> shouldn't tweak argument slot alignment based on the alignment of these
> arguments either.
> 
> This patch fixes the ICE we issued on pr83487.{c,C}.
> As the compat tests show, we are now ABI compatible with clang++ trunk
> for TYPE_EMPTY_P arguments with size <= 16 bytes, the alignment is ignored
> when passing those; the arguments are NO_CLASS, NO_CLASS and the psABI
> then doesn't say anything on passing them anywhere.  In C we are compatible
> on all the tests because all the structs have actually zero size (but the
> alignment is still ignored).  The case where we are incompatible on is
>> 16 bytes TYPE_EMPTY_P, we need to decide if want to do it anyway and
> update the psABI for that, or if we follow strictly the current psABI.
> But in that case the fix would still be to just not set TYPE_EMPTY_P on
> the larger empty structures (what is in pr83487_2*.C), and the
> ix86_function_arg_boundary change would still work.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
> 
> 2017-12-21  Jakub Jelinek  <ja...@redhat.com>
> 
>       PR middle-end/83487
>       * config/i386/i386.c (ix86_function_arg_boundary): Return
>       PARM_BOUNDARY for TYPE_EMPTY_P types.
> 
>       * gcc.c-torture/compile/pr83487.c: New test.
>       * gcc.dg/compat/pr83487-1.h: New file.
>       * gcc.dg/compat/pr83487-1_main.c: New test.
>       * gcc.dg/compat/pr83487-1_x.c: New file.
>       * gcc.dg/compat/pr83487-1_y.c: New file.
>       * gcc.dg/compat/pr83487-2_main.c: New test.
>       * gcc.dg/compat/pr83487-2_x.c: New file.
>       * gcc.dg/compat/pr83487-2_y.c: New file.
>       * g++.dg/abi/pr83487.C: New test.
>       * g++.dg/compat/abi/pr83487-1_main.C: New test.
>       * g++.dg/compat/abi/pr83487-1_x.C: New file.
>       * g++.dg/compat/abi/pr83487-1_y.C: New file.
>       * g++.dg/compat/abi/pr83487-2_main.C: New test.
>       * g++.dg/compat/abi/pr83487-2_x.C: New file.
>       * g++.dg/compat/abi/pr83487-2_y.C: New file.
OK
jeff

Reply via email to