"H.J. Lu" <[email protected]> writes:

> commit b4c215b36d63e1c264d8c1bd5d34f9aef1bb8463
> Author: H.J. Lu <[email protected]>
> Date:   Sat Jun 28 06:27:25 2025 +0800
>
>     Adjust check for addressable misaligned stack argument
>
> ignores arguments passed on stack since caller is responsible to align
> the outgoing stack for arguments passed on stack.  However, callee may
> spill a register argument:
>
> (set (mem/c:V2DI (plus:DI (reg/f:DI 7 sp)
> (const_int -16 [0xfffffffffffffff0])) [4 a1+0 S16 A128])
>      (reg:V2DI 20 xmm0 [ a1 ]))
>
> Update ix86_argument_passed_on_stack_p to check spill of register argument
> by callee.
>
> gcc/
>
> PR target/126320
> * config/i386/i386.cc (ix86_spill_register_argument_p): New
> function.
> (ix86_argument_passed_on_stack_p): Add a pattern argument.  Call
> ix86_spill_register_argument_p to check spill of register argument
> by callee.
> (ix86_update_stack_alignment): Pass pat to
> ix86_argument_passed_on_stack_p.
>
> gcc/testsuite/
>
> PR target/126320
> * gcc.target/i386/pr126320.c: New test.

IMO for tests of this shape where we do builtin_cpu_supports, we should
build the file without -march, but use the target attribute on the
called function. It is paranoid but it means we don't have a lot of pain
if (somehow) we use other instructions in main, and it sets a good
example for copying.

sam

Attachment: signature.asc
Description: PGP signature

Reply via email to