From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B0580395252D; Wed, 16 Nov 2022 02:26:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B0580395252D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668565609; bh=DQd0XKSYdb89eNrER0eEd513C/4mhY/YqZd7+/RGTlA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Sj1Xqc8HSpVWIBK2daVQZ8qtRgzvIs7aM5AO1ptzOwdKPChqgwOI879+WHuu6+kJG PCLTvjPjHrEgaEtUjd3RD62S9bWBBaxat1NQE89njpBwta6zO0+N+xej/nNot76zB4 rtchmV7ZzG1vEuM3gSOmmOCPg43qxjw7ZepsaDbo= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/90259] ICE: verify_flow_info failed (error: missing REG_EH_REGION note at the end of bb 4) Date: Wed, 16 Nov 2022 02:26:48 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 9.0 X-Bugzilla-Keywords: EH, ice-checking, ice-on-valid-code 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: linkw 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=3D90259 --- Comment #8 from CVS Commits --- The master branch has been updated by Kewen Lin : https://gcc.gnu.org/g:63e1b2e767a3f4695373c2406ff719c0a60c1858 commit r13-4079-g63e1b2e767a3f4695373c2406ff719c0a60c1858 Author: Kewen Lin Date: Tue Nov 15 20:26:07 2022 -0600 rtl: Try to remove EH edges after {pro,epi}logue generation [PR90259] After prologue and epilogue generation, the judgement on whether one memory access onto stack frame may trap or not could change, since we get more exact stack information by now. As PR90259 shows, some memory access becomes impossible to trap any more after prologue and epilogue generation, it can make subsequent optimization be able to remove it if safe, but it results in unexpected control flow status due to REG_EH_REGION note missing. This patch proposes to try to remove EH edges with function purge_all_dead_edges after prologue and epilogue generation, it simplifies CFG as early as we can and don't need any fixup in downstream passes. CFG simplification result with PR90259's case as example: *before* 18: %1:TF=3Dcall [`__gcc_qdiv'] argc:0 REG_EH_REGION 0x2 77: NOTE_INSN_BASIC_BLOCK 3 19: NOTE_INSN_DELETED 20: NOTE_INSN_DELETED 110: [%31:SI+0x20]=3D%1:DF REG_EH_REGION 0x2 116: NOTE_INSN_BASIC_BLOCK 4 111: [%31:SI+0x28]=3D%2:DF REG_EH_REGION 0x2 22: NOTE_INSN_BASIC_BLOCK 5 108: %0:DF=3D[%31:SI+0x20] REG_EH_REGION 0x2 117: NOTE_INSN_BASIC_BLOCK 6 109: %1:DF=3D[%31:SI+0x28] REG_EH_REGION 0x2 79: NOTE_INSN_BASIC_BLOCK 7 26: [%31:SI+0x18]=3D%0:DF 104: pc=3DL69 105: barrier *after* 18: %1:TF=3Dcall [`__gcc_qdiv'] argc:0 REG_EH_REGION 0x2 77: NOTE_INSN_BASIC_BLOCK 3 19: NOTE_INSN_DELETED 20: NOTE_INSN_DELETED 110: [%31:SI+0x20]=3D%1:DF 111: [%31:SI+0x28]=3D%2:DF 108: %0:DF=3D[%31:SI+0x20] 109: %1:DF=3D[%31:SI+0x28] 26: [%31:SI+0x18]=3D%0:DF 104: pc=3DL69 105: barrier PR rtl-optimization/90259 gcc/ChangeLog: * function.cc (rest_of_handle_thread_prologue_and_epilogue): Add parameter fun, and call function purge_all_dead_edges. (pass_thread_prologue_and_epilogue::execute): Name unamed param= eter as fun, and use it for rest_of_handle_thread_prologue_and_epilo= gue. gcc/testsuite/ChangeLog: * g++.target/powerpc/pr90259.C: New.=