[Bug target/111279] ICE: Segmentation fault with m68k,SJLJ and -malign-int
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111279 Jeffrey A. Law changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED CC||law at gcc dot gnu.org Resolution|--- |FIXED Target Milestone|--- |14.0 --- Comment #7 from Jeffrey A. Law --- Should be fixed on the trunk. No plans to backport.
[Bug target/111279] ICE: Segmentation fault with m68k,SJLJ and -malign-int
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111279 --- Comment #6 from GCC Commits --- The master branch has been updated by Jeff Law : https://gcc.gnu.org/g:bdcf7226c9fe87352466eb9a6bfc58fa24b3e5e1 commit r14-8324-gbdcf7226c9fe87352466eb9a6bfc58fa24b3e5e1 Author: Mikael Pettersson 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
[Bug target/111279] ICE: Segmentation fault with m68k,SJLJ and -malign-int
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111279 --- Comment #5 from Thorsten Otto --- I don't mind. If your patch also contains a test case, just use that.
[Bug target/111279] ICE: Segmentation fault with m68k,SJLJ and -malign-int
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111279 Mikael Pettersson changed: What|Removed |Added CC||mikpelinux at gmail dot com --- Comment #4 from Mikael Pettersson --- (In reply to Thorsten Otto from comment #3) > Created attachment 55837 [details] > Avoid segmentation fault when calling assign_temp with a NULL type pointer > > Attached is a potential patch to fix that. > > The above mentioned commit was made for gcc 4.3, and all compiler versions > after that are affected by it. This patch also fixes PR82420. That PR contains a tidied up patch with a test case and proper attribution to your original. Will you submit your patch or should I submit mine?
[Bug target/111279] ICE: Segmentation fault with m68k,SJLJ and -malign-int
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111279 --- Comment #3 from Thorsten Otto --- Created attachment 55837 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55837=edit Avoid segmentation fault when calling assign_temp with a NULL type pointer Attached is a potential patch to fix that. The above mentioned commit was made for gcc 4.3, and all compiler versions after that are affected by it.
[Bug target/111279] ICE: Segmentation fault with m68k,SJLJ and -malign-int
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111279 Thorsten Otto changed: What|Removed |Added CC||ad...@tho-otto.de --- Comment #2 from Thorsten Otto --- emit_push_insn is called from https://gcc.gnu.org/git?p=gcc.git;a=blob;f=gcc/calls.cc;h=1f3a6d5c45099499deeef63f867ed11774dec47e;hb=HEAD#l4585 where only a NULL_TREE pointer is passed for the type, and crashes when trying to access the TREE_CODE. The call to assign_temp was inserted by https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=46bd2beed4c78dcb32fcde4913815527c14e5e17
[Bug target/111279] ICE: Segmentation fault with m68k,SJLJ and -malign-int
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111279 --- Comment #1 from Andrew Pinski --- sjlj-exceptions is very much not tested as much as the others.