[Bug target/126450] [16/17 Regression] wrong code at -O2 -mavx2 since r16-8339

"cvs-commit at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126450

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by H.J. Lu <[email protected]>:

https://gcc.gnu.org/g:01c7083b70a6bbf620d2cb2ce887baf501fe2f1f

commit r16-9519-g01c7083b70a6bbf620d2cb2ce887baf501fe2f1f
Author: H.J. Lu <[email protected]>
Date:   Sat Aug 1 06:07:43 2026 +0800

    x86: Check DECL_INCOMING_RTL for argument passing check

    For argument declaration, its DECL_INCOMING_RTL holds an RTL for the
    stack slot or register where the data was actually passed.  If an
    argument's DECL_INCOMING_RTL is a memory operand, it is passed on stack
    by caller.  Change ix86_argument_passed_on_stack_p to return true if the
    argument's DECL_INCOMING_RTL is a memory operand.

    gcc/

            PR target/126320
            PR target/126450
            PR target/126529
            * config/i386/i386.cc (ix86_spill_register_argument_p): Removed.
            (ix86_argument_passed_on_stack_p): Remove the second argument.
            Return true if the argument's DECL_INCOMING_RTL is a memory
            operand.
            (ix86_update_stack_alignment): Updated.

    gcc/testsuite/

            PR target/126320
            PR target/126450
            PR target/126529
            * gcc.target/i386/pr126529-1.c: New test.
            * gcc.target/i386/pr126529-2.c: Likewise.
            * gcc.target/i386/pr126529-3.c: Likewise.
            * gcc.target/i386/pr126529-4.c: Likewise.

    Signed-off-by: H.J. Lu <[email protected]>
    (cherry picked from commit b06b1ea150558cfe83111b48b94b4297cb3dec05)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.