From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E502038582B4; Wed, 31 Aug 2022 13:37:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E502038582B4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661953062; bh=C2yjn2EpBJpFjAPTfWcGn3HJld2uc70wjr3rSbzsz/k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FwTHFggbvxCbc5AiH2hVy9NKVST5Ks6tKRrcZgD8r+XjocKPIN2VxtG/XhSFezlu9 OTnV9ytC0oADpGwLvkFZgtygQYaBjpJ/rmZXmXzbaC2MvVWWp3nVyQ/s8SYJwSq3Y2 xDxYCerj8TtrRPAMDQlH2Laa+PuWkSnE7LCUGk8U= From: "amonakov at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106781] [13 Regression] ICE: verify_flow_info failed (error: returns_twice call is not first in basic block 2) since r13-1754-g7a158a5776f5ca95 Date: Wed, 31 Aug 2022 13:37:42 +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: ice-checking, ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: amonakov at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 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=3D106781 --- Comment #5 from Alexander Monakov --- GCC discovers that 'bar' is noreturn, tries to remove its LHS but unfortuna= tely cgraph.cc:cgraph_edge::redirect_call_stmt_to_callee wants to emit an assign= ment of SSA default-def to the LHS. fixup_noreturn_call seems to handle that in a smarter way. Is it possible to simply let fixup_noreturn_call do its thing? diff --git a/gcc/cgraph.cc b/gcc/cgraph.cc index 8d6ed38ef..6597de669 100644 --- a/gcc/cgraph.cc +++ b/gcc/cgraph.cc @@ -1567,7 +1567,7 @@ cgraph_edge::redirect_call_stmt_to_callee (cgraph_edge *e) /* If the call becomes noreturn, remove the LHS if possible. */ tree lhs =3D gimple_call_lhs (new_stmt); - if (lhs + if (0 && lhs && gimple_call_noreturn_p (new_stmt) && (VOID_TYPE_P (TREE_TYPE (gimple_call_fntype (new_stmt))) || should_remove_lhs_p (lhs)))=