From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 57AAB3858D3C; Mon, 24 Jan 2022 21:57:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 57AAB3858D3C From: "dani at danielbertalan dot dev" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/103819] [10/11/12 Regression] ICE in redirect_callee, at cgraph.c:1389 with __attribute__((flatten)) and -O2 since r11-7940-ge7fd3b783238d034 Date: Mon, 24 Jan 2022 21:57:08 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-checking, ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: dani at danielbertalan dot dev X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.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 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: Mon, 24 Jan 2022 21:57:08 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103819 --- Comment #3 from Daniel Bertalan --- Here's an even smaller test case (https://gcc.godbolt.org/z/ee9GceMx3): =3D=3D=3D template struct Optional { ~Optional() { if (m_has_value) value(); } T value(); bool m_has_value{}; }; __attribute__((flatten)) int main(){ Optional> _temporary_result{}; return 0; } =3D=3D=3D during IPA pass: inline :12:1: internal compiler error: in redirect_callee, at cgraph.cc:13= 89 12 | } | ^ 0x215b739 internal_error(char const*, ...) ???:0 0x73b7e7 fancy_abort(char const*, int, char const*) ???:0 0xbe2bbe cgraph_edge::redirect_callee(cgraph_node*) ???:0 0xe6b781 ipa_merge_fn_summary_after_inlining(cgraph_edge*) ???:0 0xe85396 inline_call(cgraph_edge*, bool, vec= *, int*, bool, bool*) ???:0=