From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A4D3E3875A24; Mon, 25 Jul 2022 15:13:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A4D3E3875A24 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/106208] [12/13 Regression] ICE in branch_prob, at profile.cc:1459 since r12-5275-gbcebd05720540e25 Date: Mon, 25 Jul 2022 15:13:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: component priority 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, 25 Jul 2022 15:13:12 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106208 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Component|fortran |middle-end Priority|P3 |P2 --- Comment #2 from Richard Biener --- #1 0x0000000001423960 in branch_prob (thunk=3Dfalse) at /home/rguenther/src/trunk/gcc/profile.cc:1459 1459 gcc_checking_assert (!RESERVED_LOCATION_P (loc)); (gdb) l 1454 gcov_position_t offset =3D 0; 1455 1456 if (bb =3D=3D ENTRY_BLOCK_PTR_FOR_FN (cfun)->next_bb) 1457 { 1458 location_t loc =3D DECL_SOURCE_LOCATION (current_function_decl); 1459 gcc_checking_assert (!RESERVED_LOCATION_P (loc)); 1460 seen_locations.add (loc); 1461 expanded_location curr_location =3D expand_location (= loc); 1462 output_location (&streamed_locations, curr_location.f= ile, 1463 MAX (1, curr_location.line), &offset, bb); (gdb) p loc $1 =3D 0 (gdb) p current_function_decl $2 =3D (gdb) p $2->decl_common.artificial_flag=20 $3 =3D 0 I was to say that for artificial functions a reserved location could be expected. But _caf_init.0 isn't even artificial (which is probably a bug). In the non-entry block case we do if (!RESERVED_LOCATION_P (loc)) { seen_locations.add (loc); which seems an obvious thing to do here as well. But it's really Thomas who should comment since he put in the assert (uncovering a previous issue). Not really a frontend bug (if it were DECL_ARTIFICIAL the ICE would occur anyway).=