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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jeff Law <l...@gcc.gnu.org>:

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

commit r14-8324-gbdcf7226c9fe87352466eb9a6bfc58fa24b3e5e1
Author: Mikael Pettersson <mikpeli...@gmail.com>
Date:   Sun Jan 21 15:55:49 2024 -0700

    Re: [PATCH] Avoid ICE with m68k-elf -malign-int and libcalls

    >> emit_library_call_value_1 calls emit_push_insn with NULL_TREE
    >> for TYPE.  Sometimes emit_push_insn needs to assign a temp with
    >> that TYPE, which causes a segfault.
    >>
    >> Fixed by computing the TYPE from MODE when needed.
    >>
    >> Original patch by Thorsten Otto.
    >>
    [ ... ]
    > This really needs to happen in the two call paths which pass in
    > NULL_TREE for the type.  Note how the type is used to determine padding
    > earlier in emit_push_insn.  That would also make the code more
    > consistent with the comment before emit_push_insn which implies that
    > both MODE and TYPE are valid.
    >
    >
    > Additionally you should bootstrap and regression test this patch on at
    > least one target.

    Updated as requested, and bootstrapped and tested on
    {x86_64,aarch64,m68k}-linux-gnu without regressions.

    gcc/

            PR target/82420
            PR target/111279
            * calls.cc (emit_library_call_value_1): Pass valid TYPE
            to emit_push_insn.
            * expr.cc (emit_push_insn): Likewise.

    gcc/testsuite/

            PR target/82420
            * gcc.target/m68k/pr82420.c: New test.

                Co-authored-by: Thorsten Otto  <ad...@tho-otto.de>

Reply via email to