From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] debug/112718 - reset all type units with -ffat-lto-objects
Date: Tue, 23 Jan 2024 08:04:51 +0100 (CET) [thread overview]
Message-ID: <20240123070452.21441136A4@imap1.dmz-prg2.suse.org> (raw)
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.
Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.
Richard.
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.
---
gcc/dwarf2out.cc | 12 ------------
gcc/testsuite/gcc.dg/debug/pr112718.c | 12 ++++++++++++
2 files changed, 12 insertions(+), 12 deletions(-)
create mode 100644 gcc/testsuite/gcc.dg/debug/pr112718.c
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_hasher> 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;
--
2.35.3
reply other threads:[~2024-01-23 7:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240123070452.21441136A4@imap1.dmz-prg2.suse.org \
--to=rguenther@suse.de \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).