From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E73F1382A21D; Thu, 15 Dec 2022 08:28:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E73F1382A21D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671092897; bh=ZnPamkGZMaDAETWPMsfsYrD6+cOswqWEtRCI7TRbXUo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jrz9l0jP+wVxRZ2aBVMRRELKUzFLLs+7zSHoe6t7Yz7OT+Do4If10JnmBk+l2sT67 w0TOHlF8lH/7BZmBtDM/BOfVjG/hSWS6wmlVZXxWakyCR+JtlLh1R8Y8HGYtvc8Pqx nbriKl4KB828JaKVUJO0m0B3w61N9FLWvGJLTCLo= From: "cvs-commit at gcc dot 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: Thu, 15 Dec 2022 08:28:14 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108095 --- Comment #8 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:bf3ce6f84a7a994a0fc87419b383b9ce4efed442 commit r13-4713-gbf3ce6f84a7a994a0fc87419b383b9ce4efed442 Author: Jakub Jelinek 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 =3D &s; __asm__ goto("" : "=3Dr" MEM[(T *)s.0_1] : : : "lab" lab); with __asm__ goto("" : "=3Dr" s : : : "lab" lab); and because s is no longer addressable, we are rewriting it into ssa and want __asm__ goto("" : "=3Dr" s_7 : : : "lab" lab); plus debug stmt # DEBUG s =3D> 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 !=3D 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 !=3D 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 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 edg= e. Test whether there are no PHI nodes next to the single predeces= sor test. * gcc.dg/pr108095.c: New test.=