From patchwork Tue Jan 23 07:04:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1889522 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=kKVm4RY0; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=Cm+zCsUJ; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=kKVm4RY0; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=Cm+zCsUJ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TJyld0DYDz1yPg for ; Tue, 23 Jan 2024 18:05:15 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 42B0D3858415 for ; Tue, 23 Jan 2024 07:05:13 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 6946A3858D32 for ; Tue, 23 Jan 2024 07:04:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6946A3858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6946A3858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705993494; cv=none; b=r0TGJVE+LB4DLNJ3icAXgYKodoctTdgv3AYVDzkf0abIbTmOCns6BrclFaUG66AVV1gvZ1Y41ht390bXhKJj+WH7tNwvMoNTXxWCxCceQsN8QcP0Gm6wEiZYdYVd+WlcWe3cAmx+lp8E4gP9arKo1LiFXYBWCkEcfZH+yRc2YSk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705993494; c=relaxed/simple; bh=CZ5Ml1KLUDNCH9SvdWgaCCzQKMb8nUDqnE3JpI0ugNs=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:MIME-Version:Message-Id; b=G+KRgYjqa0RJzgeK3XQ2OaZdoGTGIU9TL0B373Nmq6tp0yfMd6LhHKwSijPm1zhMDQ9lexrDy/lUdyoE1Vc2v3Dm8O07x8TdT63GV3oRQnUipoyrTBmazehToy4nw6TqxPHZxcspPrc84PU3WteOOa5pGvxO5clROhrBjxEy8+c= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3E60D1F822 for ; Tue, 23 Jan 2024 07:04:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1705993492; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=6qqfNtZ+iRH+xcdP+aCVwnhTiOfxNba0RfUBlMt24O8=; b=kKVm4RY0AF3ein5I2yUr8kO2B9n4WHhFr1DZc5Z0IpvlE0Tu7KsIOrUO8Gf+dbamSDio7B ii12v8RcfA4DxAiAQ8NOvNcIGTUKWQ6fD6i4H3zvanD21xqs7dEt76lzDqrY3703KinhEq 9CeUGdlQ4xfLkjBXT6jxiOLAl0sQjY0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1705993492; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=6qqfNtZ+iRH+xcdP+aCVwnhTiOfxNba0RfUBlMt24O8=; b=Cm+zCsUJvdZYLUvRITsIqAA//M0/bUoKu2zuGzQrEFgL67o/cDohTQRuecPDNAbN3NhF4h MPKxiuMOzLXnRTCA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1705993492; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=6qqfNtZ+iRH+xcdP+aCVwnhTiOfxNba0RfUBlMt24O8=; b=kKVm4RY0AF3ein5I2yUr8kO2B9n4WHhFr1DZc5Z0IpvlE0Tu7KsIOrUO8Gf+dbamSDio7B ii12v8RcfA4DxAiAQ8NOvNcIGTUKWQ6fD6i4H3zvanD21xqs7dEt76lzDqrY3703KinhEq 9CeUGdlQ4xfLkjBXT6jxiOLAl0sQjY0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1705993492; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=6qqfNtZ+iRH+xcdP+aCVwnhTiOfxNba0RfUBlMt24O8=; b=Cm+zCsUJvdZYLUvRITsIqAA//M0/bUoKu2zuGzQrEFgL67o/cDohTQRuecPDNAbN3NhF4h MPKxiuMOzLXnRTCA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 21441136A4 for ; Tue, 23 Jan 2024 07:04:52 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 8rEcBhRlr2UmWQAAD6G6ig (envelope-from ) for ; Tue, 23 Jan 2024 07:04:52 +0000 Date: Tue, 23 Jan 2024 08:04:51 +0100 (CET) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] debug/112718 - reset all type units with -ffat-lto-objects MIME-Version: 1.0 Message-Id: <20240123070452.21441136A4@imap1.dmz-prg2.suse.org> Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -4.30 X-Spamd-Result: default: False [-4.30 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[gcc-patches@gcc.gnu.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org 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_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;