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

--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Alfie Richards
<[email protected]>:

https://gcc.gnu.org/g:d56eb2fbcb5a65ca738534fab640e36b9061b0b2

commit r16-5427-gd56eb2fbcb5a65ca738534fab640e36b9061b0b2
Author: Alfie Richards <[email protected]>
Date:   Wed Nov 19 11:47:09 2025 +0000

    aarch64: Fix ICE when laying out arguments of size 0 [PR 122763]

    When laying out arguments of size 0, previously would return the next
argument
    passing register, without checking that there was a next one.

    This was fine for AAPCS as it used R0-R7 for argument passing and R9 would
be
    occasionally be assigned, but never used.

    However, with the introduction of preserve_none PCS there is no obvious
"next
    register" to use as aaaa dummy value, and so when laying out in the
    "next register" when there were no more, an assert triggered an ICE.

    This patch fixes this ICE by instead using NULL_RTX for arguments of size
0.

            PR target/122763

    gcc/ChangeLog:

            * config/aarch64/aarch64.cc (aarch64_layout_arg): Return NULL_RTX
for
            arguments of size 0.
            (aarch64_function_arg_advance): Remove assert.

    gcc/testsuite/ChangeLog:

            * gcc.target/aarch64/pr122763.c: New test.

Reply via email to