From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8BFC03986433; Wed, 16 Sep 2020 19:20:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BFC03986433 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1600284038; bh=lJB6BMWWszv1V6v5A9252NVtDwDQEyTQwgU1ZTERbm4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hSVcngYcxcLmGOd+sGgW3lX6ONqyhLEyvBQeKPdzLRMfwk6DquUgQr6jtuelKWA0A EyxWSAmPWwNm39cCZA2zjRUZL/M4ISUlGgkpEnHlX7jz2oywrwE8ECy+s2hE+bmgtq TRHakq08nJsjqQIRDEmJEXvM0c02KdhCHJykJGSk= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/94618] [8/9 Regression] '-fcompare-debug' failure (length) with -O2 -fnon-call-exceptions since r8-565-g7581ce9a1ad6df9c Date: Wed, 16 Sep 2020 19:20:38 +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: 10.0 X-Bugzilla-Keywords: ra 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: 8.5 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 19:20:38 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94618 --- Comment #11 from CVS Commits --- The releases/gcc-9 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:dea597314f4503228e23e887ddbb773cbf197093 commit r9-8881-gdea597314f4503228e23e887ddbb773cbf197093 Author: Jakub Jelinek Date: Fri Apr 17 10:33:27 2020 +0200 Fix -fcompare-debug issue in delete_insn_and_edges [PR94618] delete_insn_and_edges calls purge_dead_edges whenever deleting the last insn in a bb, whatever it is. If it called it only for mandatory last insns in the basic block (that may not be followed by DEBUG_INSNs, dunno if t= hat is control_flow_insn_p or something more complex), that wouldn't be a problem, but as it calls it on any last insn and can actually do someth= ing in the bb, if such an insn is followed by one more more DEBUG_INSNs and nothing else in the same bb, we don't call purge_dead_edges with -g and= do call it with -g0. On the testcase, there are two reg-to-reg moves with REG_EH_REGION notes (previously memory accesses but simplified and yet not optimized), and = the second is followed by DEBUG_INSNs; the second move is delete_insn_and_e= dges and after removing it, for -g0 purge_dead_edges removes the REG_EH_REGI= ON from the now last insn in the bb (the first reg-to-reg move), while for -g it isn't called and things diverge from that quickly on. Fixed by calling purdge_dead_edges even if we remove the last real insn followed only by DEBUG_INSNs in the same bb. 2020-04-17 Jakub Jelinek PR rtl-optimization/94618 * cfgrtl.c (delete_insn_and_edges): Set purge not just when insn is the BB_END of its block, but also when it is only follo= wed by DEBUG_INSNs in its block. * g++.dg/opt/pr94618.C: New test. (cherry picked from commit c41884a09206be0e21cad7eea71b9754daa969d4)=