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: 190756 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp163471dyi; Mon, 22 Jan 2024 23:05:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IEM5mp/+LRlfx5WLbmwliC7CnJVANcwUfVIj1TLHl4OHTTyX5q5btoAENgBc2Pm4Aasbk11 X-Received: by 2002:a54:4605:0:b0:3bd:95c0:3a3c with SMTP id p5-20020a544605000000b003bd95c03a3cmr5018913oip.69.1705993535346; Mon, 22 Jan 2024 23:05:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705993535; cv=pass; d=google.com; s=arc-20160816; b=jprEA7dWghFsHAqxnQXb9OvSnGx8zb2ldk0e2WZNwhQbDdaoypa/FL39dTKBVERff+ LPEojW77GpA1wNZsUPAk6TD0Kr59wohIlO6BoC8M4tunFCDU3hEpWVv7qoQ1Sj1fNFJI SqDlNWuyRE9a5kq4n9dX4cmHDl6MrhRvbIMQi2ObZQWnVRavTjbyrQCxSKBDFtGbjtPT CQe9TuhKuIMzatPGhTxmSaQ6BX12axV9ohPclr/AsFTpSkLFgtiG9mROcYTtZvNjA6dh HD6ToY1cYJQ107gzgevgVxr73+0NqJSoxhM+tI+1kpJblX9BI8LaYdXs8W2fl+avt6RZ QrIQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:message-id:mime-version:subject :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=6qqfNtZ+iRH+xcdP+aCVwnhTiOfxNba0RfUBlMt24O8=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=TA4FJbd6qBjXHKWe7w3e4HL4+mxhS9LbILn2yUbV92mQ53LVFsEbzBAdR0dT//hLIs e8ky2r5RD/Zd0R2zVS32mncpL7z8/To2WlKDC0yayU1RBzzReH8LUr3jPRVlQ+dYGOAD e7RyYKcQDiSBwr8DeW0ZbXOR16tt5me2oiVNoX3l6yR2YZ3MOxSsErr6vPUnwGpG47yY P3TbpLs7QxUwQjkJpglHNe7WnGMoPlekeVB6rDo3vrABkzi7npoMu5hEmUyMGHqrrKoO G0UH1RgLGp3bLTDWF82TQe8gikcREdppaf/sTru0Vd+GPAu0/oqsJ+Z4n+t4IdpyGqsG Sn8w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=kKVm4RY0; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=kKVm4RY0; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id du1-20020a05620a47c100b0078394eddfc4si6137828qkb.599.2024.01.22.23.05.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 23:05:35 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=kKVm4RY0; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=kKVm4RY0; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0D93A3858C39 for ; Tue, 23 Jan 2024 07:05:35 +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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788863877223518389 X-GMAIL-MSGID: 1788863877223518389 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;