From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id BE8DA3858D32; Tue, 23 Jan 2024 07:06:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BE8DA3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705993571; bh=VoW6HDy3BqN1sYfwbThBWVb7IV57FjWaNfbwmv5Fya8=; h=From:To:Subject:Date:From; b=ShJLBpzil1Ue0mpqFjvQS6uzSDeVmzFggdibiOcXHi7OJEf1RiEbq0Z/vl44oPuxS F70NiqLRTjf7Dto1qUsF4lY/+i3L6E1yVtbhMA338pzZ7ga09ZKvZk8aGNyZcSgfl6 KKOvqtdZxl4Uk4BtYZ0LpzDoKPHQYJ19CXEwxqkU= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-8345] debug/112718 - reset all type units with -ffat-lto-objects X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/heads/master X-Git-Oldrev: e861d76076e213d036f880b722a885918ee8cc58 X-Git-Newrev: 7218f5050cb7163edae331f54ca163248ab48bfa Message-Id: <20240123070611.BE8DA3858D32@sourceware.org> Date: Tue, 23 Jan 2024 07:06:11 +0000 (GMT) List-Id: https://gcc.gnu.org/g:7218f5050cb7163edae331f54ca163248ab48bfa commit r14-8345-g7218f5050cb7163edae331f54ca163248ab48bfa Author: Richard Biener Date: Mon Jan 22 15:42:59 2024 +0100 debug/112718 - reset all type units with -ffat-lto-objects When mixing -flto, -ffat-lto-objects and -fdebug-type-section we fail to reset all type units after early output resulting in an ICE when attempting to add then duplicate sibling attributes. PR debug/112718 * dwarf2out.cc (dwarf2out_finish): Reset all type units for the fat part of an LTO compile. * gcc.dg/debug/pr112718.c: New testcase. Diff: --- gcc/dwarf2out.cc | 12 ------------ gcc/testsuite/gcc.dg/debug/pr112718.c | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index 1c994bb8b9b..0b8a3002292 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -32276,24 +32276,12 @@ dwarf2out_finish (const char *filename) reset_dies (comp_unit_die ()); for (limbo_die_node *node = cu_die_list; node; node = node->next) reset_dies (node->die); - - hash_table comdat_type_table (100); for (ctnode = comdat_type_list; ctnode != NULL; ctnode = ctnode->next) { - comdat_type_node **slot - = comdat_type_table.find_slot (ctnode, INSERT); - - /* Don't reset types twice. */ - if (*slot != HTAB_EMPTY_ENTRY) - continue; - /* Remove the pointer to the line table. */ remove_AT (ctnode->root_die, DW_AT_stmt_list); - if (debug_info_level >= DINFO_LEVEL_TERSE) reset_dies (ctnode->root_die); - - *slot = ctnode; } /* Reset die CU symbol so we don't output it twice. */ diff --git a/gcc/testsuite/gcc.dg/debug/pr112718.c b/gcc/testsuite/gcc.dg/debug/pr112718.c new file mode 100644 index 00000000000..ff80ca5a298 --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/pr112718.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lto } */ +/* { dg-options "-g -fdebug-types-section -flto -ffat-lto-objects" } */ + +struct { + int h; + unsigned char data[20 + 24 * 6]; +} _EC_X9_62_PRIME_192V2; +struct { + int h; + unsigned char data[20 + 24 * 6]; +} _EC_X9_62_PRIME_192V3;