On 1/16/24 09:55, Mikael Pettersson wrote:
On Thu, 4 Jan 2024 14:39:23 -0700, Jeff Law wrote:
On 1/4/24 02:23, Mikael Pettersson wrote:
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.

gcc/

2024-01-03  Thorsten Otto  <ad...@tho-otto.de>
              Mikael Pettersson  <mikpeli...@gmail.com>

        PR target/82420
        PR target/111279
        * expr.cc (emit_push_insn): If TYPE is NULL compute it
        from MODE before calling assign_temp.

gcc/teststuite/

2024-01-03  Mikael Pettersson  <mikpeli...@gmail.com>

        PR target/82420
        * gcc.target/m68k/pr82420.c: New test.
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/

2024-01-16  Thorsten Otto  <ad...@tho-otto.de>
             Mikael Pettersson  <mikpeli...@gmail.com>

        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/teststuite/

2024-01-16  Mikael Pettersson  <mikpeli...@gmail.com>

        PR target/82420
        * gcc.target/m68k/pr82420.c: New test.
I made minor adjustments to the commit message and pushed this to the trunk.

jeff

Reply via email to