diff options
author | Mikael Pettersson <mikpelinux@gmail.com> | 2024-01-21 15:55:49 -0700 |
---|---|---|
committer | Jeff Law <jlaw@ventanamicro.com> | 2024-01-21 15:59:33 -0700 |
commit | bdcf7226c9fe87352466eb9a6bfc58fa24b3e5e1 (patch) | |
tree | d47f6bbcf0d654bbbdbf7ffacc61978b83240544 /gcc/calls.cc | |
parent | 5efd98c6f818ce2c55f54c34008557d0a3f953aa (diff) | |
download | gcc-bdcf7226c9fe87352466eb9a6bfc58fa24b3e5e1.zip gcc-bdcf7226c9fe87352466eb9a6bfc58fa24b3e5e1.tar.gz gcc-bdcf7226c9fe87352466eb9a6bfc58fa24b3e5e1.tar.bz2 |
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 <admin@tho-otto.de>
Diffstat (limited to 'gcc/calls.cc')
-rw-r--r-- | gcc/calls.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/calls.cc b/gcc/calls.cc index 7c35b1a..01f44734 100644 --- a/gcc/calls.cc +++ b/gcc/calls.cc @@ -4580,8 +4580,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, } } - emit_push_insn (val, mode, NULL_TREE, NULL_RTX, parm_align, - partial, reg, 0, argblock, + emit_push_insn (val, mode, lang_hooks.types.type_for_mode (mode, 0), + NULL_RTX, parm_align, partial, reg, 0, argblock, (gen_int_mode (argvec[argnum].locate.offset.constant, Pmode)), reg_parm_stack_space, |