From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 826D4385841D; Thu, 20 Jan 2022 10:59:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 826D4385841D From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/103874] [11/12 Regression] ICE in internal_error on riscv64 and -gsplit-dwarf Date: Thu, 20 Jan 2022 10:59:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 11.2.1 X-Bugzilla-Keywords: 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: P2 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.3 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: Thu, 20 Jan 2022 10:59:09 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103874 --- Comment #9 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:68f03ac49cb4f585dbce78dc9e4c4a9ec950e83c commit r12-6758-g68f03ac49cb4f585dbce78dc9e4c4a9ec950e83c Author: Jakub Jelinek Date: Thu Jan 20 11:58:20 2022 +0100 dwarf2out: Fix -gsplit-dwarf on riscv [PR103874] riscv*-*-* are the only modern targets that !HAVE_AS_LEB128 (apparently due to some aggressive linker optimizations). As the following testcase shows, we mishandle in index_rnglists the !HAVE_AS_LEB128 && !have_multiple_function_sections case. output_rnglists does roughly: FOR_EACH_VEC_SAFE_ELT (ranges_table, i, r) { ... if (block_num > 0) { ... if (HAVE_AS_LEB128) { if (!have_multiple_function_sections) { // code not using r->*_entry continue; } // code that sometimes doesn't use r->*_entry, // sometimes r->begin_entry } else if (dwarf_split_debug_info) { // code that uses both r->begin_entry and r->end_entry } else { // code not using r->*_entry } } else if (block_num < 0) { if (!have_multiple_function_sections) gcc_unreachable (); ... } } and index_rnglists is what sets up those r->{begin,end}_entry members. The code did an early if (!have_multiple_function_sections) continue; which is fine for the HAVE_AS_LEB128 case, because r->*_entry is not used in that case, but not for !HAVE_AS_LEB128 that uses it anyway. 2022-01-20 Jakub Jelinek PR debug/103874 * dwarf2out.cc (index_rnglists): For !HAVE_AS_LEB128 and block_num > 0, index entry even if !have_multiple_function_sections. * gcc.dg/debug/dwarf2/pr103874.c: New test.=