public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108095] powerpc-linux / powerpc64-linux: ICEs when building Linux's arch/powerpc/kernel/align.c (asm goto) Date: Fri, 10 Feb 2023 17:44:26 +0000 [thread overview] Message-ID: <bug-108095-4-r6H45T1ud9@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-108095-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108095 --- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>: https://gcc.gnu.org/g:7e54e5a2bba69dc7fcbc88fe8cb20c91aaafabd2 commit r12-9126-g7e54e5a2bba69dc7fcbc88fe8cb20c91aaafabd2 Author: Jakub Jelinek <jakub@redhat.com> Date: Thu Dec 15 09:26:44 2022 +0100 into-ssa: Fix emitting debug stmts after asm goto [PR108095] The following testcase ICEs, because ccp1 replaced s.0_1 = &s; __asm__ goto("" : "=r" MEM[(T *)s.0_1] : : : "lab" lab); with __asm__ goto("" : "=r" s : : : "lab" lab); and because s is no longer addressable, we are rewriting it into ssa and want __asm__ goto("" : "=r" s_7 : : : "lab" lab); plus debug stmt # DEBUG s => s_7 The code assumes that there is at most one non-EH edge in that case, but with the addition of outputs to asm goto that is no longer the case, we can have many outgoing edges. The patch keeps the checking assertion that there is at most one such edge for everything but asm goto, but moves the addition of the debug stmt into the loop, so that it can be added on all edges where it is possible, not just one of them. Furthermore, looking at gsi_insert_on_edge_immediate -> gimple_find_edge_insert_loc, the conditions to insert stmt there to the destination block are if (single_pred_p (dest) && gimple_seq_empty_p (phi_nodes (dest)) && dest != EXIT_BLOCK_PTR_FOR_FN (cfun)) (plus there is code to insert it in the previous block but that is never true when the pred is known to be stmt_ends_bb_p), while mayube_register_def was just checking if (ef && single_pred_p (ef->dest) && ef->dest != EXIT_BLOCK_PTR_FOR_FN (cfun)) so if for whatever reason ef->dest had any PHIs, we'd split the edge for -g and not for -g0, something we must avoid for -fcompare-debug stability. So, I've added the no phi_nodes check too. 2022-12-15 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/108095 * tree-into-ssa.cc (maybe_register_def): Insert debug stmt on all non-EH edges from asm goto if they have a single predecessor rather than asserting there is at most one such edge. Test whether there are no PHI nodes next to the single predecessor test. * gcc.dg/pr108095.c: New test. (cherry picked from commit bf3ce6f84a7a994a0fc87419b383b9ce4efed442)
next prev parent reply other threads:[~2023-02-10 17:44 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-12-14 8:55 [Bug tree-optimization/108095] New: " jbglaw@lug-owl.de 2022-12-14 9:45 ` [Bug tree-optimization/108095] " marxin at gcc dot gnu.org 2022-12-14 9:51 ` marxin at gcc dot gnu.org 2022-12-14 10:09 ` marxin at gcc dot gnu.org 2022-12-14 11:36 ` jakub at gcc dot gnu.org 2022-12-14 13:46 ` jakub at gcc dot gnu.org 2022-12-14 15:12 ` jbglaw@lug-owl.de 2022-12-14 17:50 ` jbglaw@lug-owl.de 2022-12-15 8:28 ` cvs-commit at gcc dot gnu.org 2022-12-16 9:24 ` jakub at gcc dot gnu.org 2023-02-10 17:44 ` cvs-commit at gcc dot gnu.org [this message] 2023-05-02 20:12 ` cvs-commit at gcc dot gnu.org 2023-05-03 11:47 ` jakub at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-108095-4-r6H45T1ud9@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).