| Message ID | 20250914091030.3341C139CB@imap1.dmz-prg2.suse.org |
|---|---|
| State | Committed |
| Commit | 38666cbccff5114e2f23930fae180f03c385eb45 |
| Headers |
Return-Path: <gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 469383857B90 for <patchwork@sourceware.org>; Sun, 14 Sep 2025 09:11:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 469383857B90 Authentication-Results: sourceware.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=Vm0lckl9; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=HGa+1N6T; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=Vm0lckl9; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=HGa+1N6T 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 E0AC63858D39 for <gcc-patches@gcc.gnu.org>; Sun, 14 Sep 2025 09:10:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E0AC63858D39 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 E0AC63858D39 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=1757841032; cv=none; b=ICpNMdoA4nL8HF2xB9MJRkbEgNR2UkbNl1/hmJ03FEZJrF6phveZSyhkOJREi8uKBHYZF3YQkKtC3b2strQhhseOGie8y/TZgLWE5qUhkm6W0CBbXhIXxqS7DofoLs7n3eqrDY0vOmpLWGAi2sgyLyRJw1WJJ48EJpLdJs6VQ5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1757841032; c=relaxed/simple; bh=j/zdYCV0ltnZyWdKx81a+kaB5eJFTgLEpdvqiLtsYzA=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:MIME-Version:Message-Id; b=AbhUoeJ5uS04n6c7LGCqasO8/HB2zKT1wE9hyozY89HOPm7GtAo5yBh8DihJc/RKBDNPlfK1iOZvd8gK34CqsWaTmQzwrOTsTDRLoTbW6nGqgPRI0d6rLKt4IeaxxWBey3gkS93qwbYREy1bUsk9+BgPCdnOY3rmoismuhV5xWY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E0AC63858D39 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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 562F31F7F1; Sun, 14 Sep 2025 09:10:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1757841030; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=SXvbEtT/Gj2VTm5AuHqUp3XlzD4FzOfyZ9GwE+ozczw=; b=Vm0lckl97qHU+8YRO+AGdqxHbq5IDkLvDTBBWLk4jcEujRS2ginqrN0yfQochIS43T4gKX 3K9AEYM80+ZmrEUPD3ks1U61uL9wtTGfx98qc3yOTabIvCQRRuICPNh+b3hPcaDaiRbJLD WFt9nYH/kgS/jiFDv7yQZT5B3/PVcm0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1757841030; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=SXvbEtT/Gj2VTm5AuHqUp3XlzD4FzOfyZ9GwE+ozczw=; b=HGa+1N6Te+j8AER4K62km1+3PuEHCOYjI2FpnEotIh77ZCwHFb1Zwwd9bo0IShkfm3JCUP 6M2EtW9eW5Ol/rBA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Vm0lckl9; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=HGa+1N6T DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1757841030; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=SXvbEtT/Gj2VTm5AuHqUp3XlzD4FzOfyZ9GwE+ozczw=; b=Vm0lckl97qHU+8YRO+AGdqxHbq5IDkLvDTBBWLk4jcEujRS2ginqrN0yfQochIS43T4gKX 3K9AEYM80+ZmrEUPD3ks1U61uL9wtTGfx98qc3yOTabIvCQRRuICPNh+b3hPcaDaiRbJLD WFt9nYH/kgS/jiFDv7yQZT5B3/PVcm0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1757841030; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=SXvbEtT/Gj2VTm5AuHqUp3XlzD4FzOfyZ9GwE+ozczw=; b=HGa+1N6Te+j8AER4K62km1+3PuEHCOYjI2FpnEotIh77ZCwHFb1Zwwd9bo0IShkfm3JCUP 6M2EtW9eW5Ol/rBA== 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 3341C139CB; Sun, 14 Sep 2025 09:10:30 +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 xryQCoaGxmhrEgAAD6G6ig (envelope-from <rguenther@suse.de>); Sun, 14 Sep 2025 09:10:30 +0000 Date: Sun, 14 Sep 2025 11:10:29 +0200 (CEST) From: Richard Biener <rguenther@suse.de> To: gcc-patches@gcc.gnu.org cc: nathanieloshead@gmail.com Subject: [PATCH] lto/121935 - visit all DECL_ARGUMENTS in free-lang-data MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Message-Id: <20250914091030.3341C139CB@imap1.dmz-prg2.suse.org> X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; MISSING_XM_UA(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:mid,suse.de:dkim]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[gmail.com]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DKIM_TRACE(0.00)[suse.de:+] X-Spam-Level: X-Rspamd-Queue-Id: 562F31F7F1 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Action: no action X-Spam-Score: -4.51 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org |
| Series |
lto/121935 - visit all DECL_ARGUMENTS in free-lang-data
|
|
Commit Message
Richard Biener
Sept. 14, 2025, 9:10 a.m. UTC
With no longer visiting TREE_CHAIN for decls we have to visit the DECL_ARGUMENT chain manually. LTO bootstrap and regtest running on x86_64-unknown-linux-gnu. I'm not sure whether LTO bootstrap worked before, but hopefully this would have fixed it. Testing non-LTO to be able to push it anyway as well. Richard. PR lto/121935 * ipa-free-lang-data.cc (find_decls_types_r): Visit DECL_ARGUMENTS chain manually. * g++.dg/lto/pr121935_0.C: New testcase. --- gcc/ipa-free-lang-data.cc | 3 ++- gcc/testsuite/g++.dg/lto/pr121935_0.C | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/lto/pr121935_0.C
Comments
Richard Biener <rguenther@suse.de> writes: > With no longer visiting TREE_CHAIN for decls we have to visit > the DECL_ARGUMENT chain manually. > > LTO bootstrap and regtest running on x86_64-unknown-linux-gnu. > > I'm not sure whether LTO bootstrap worked before I didn't have bootstrap issues myself but I only tried my usual x86_64, not other targets (which I test less often). But the patch regtests fine for me. Thanks. > but hopefully this > would have fixed it. Testing non-LTO to be able to push it anyway as > well. > > Richard. > > PR lto/121935 > * ipa-free-lang-data.cc (find_decls_types_r): Visit DECL_ARGUMENTS > chain manually. > > * g++.dg/lto/pr121935_0.C: New testcase. > --- > gcc/ipa-free-lang-data.cc | 3 ++- > gcc/testsuite/g++.dg/lto/pr121935_0.C | 13 +++++++++++++ > 2 files changed, 15 insertions(+), 1 deletion(-) > create mode 100644 gcc/testsuite/g++.dg/lto/pr121935_0.C > > diff --git a/gcc/ipa-free-lang-data.cc b/gcc/ipa-free-lang-data.cc > index 41afc6ec82f..8196cab6079 100644 > --- a/gcc/ipa-free-lang-data.cc > +++ b/gcc/ipa-free-lang-data.cc > @@ -735,7 +735,8 @@ find_decls_types_r (tree *tp, int *ws, void *data) > > if (TREE_CODE (t) == FUNCTION_DECL) > { > - fld_worklist_push (DECL_ARGUMENTS (t), fld); > + for (tree arg = DECL_ARGUMENTS (t); arg; arg = DECL_CHAIN (arg)) > + fld_worklist_push (arg, fld); > fld_worklist_push (DECL_RESULT (t), fld); > } > else if (TREE_CODE (t) == FIELD_DECL) > diff --git a/gcc/testsuite/g++.dg/lto/pr121935_0.C b/gcc/testsuite/g++.dg/lto/pr121935_0.C > new file mode 100644 > index 00000000000..a4519b1d3ad > --- /dev/null > +++ b/gcc/testsuite/g++.dg/lto/pr121935_0.C > @@ -0,0 +1,13 @@ > +// { dg-lto-do assemble } > +// { dg-lto-options {{-flto -Wno-return-type}} } > + > +struct a { > + static int b; > +}; > +template <int> struct c { > + struct d { > + d e(unsigned, unsigned, bool, bool, bool, unsigned, a); > + }; > +}; > +template <> > +c<2>::d c<2>::d::e(unsigned, unsigned, bool, bool, bool, unsigned, const a) { }
On Sun, 14 Sep 2025, Sam James wrote: > Richard Biener <rguenther@suse.de> writes: > > > With no longer visiting TREE_CHAIN for decls we have to visit > > the DECL_ARGUMENT chain manually. > > > > LTO bootstrap and regtest running on x86_64-unknown-linux-gnu. > > > > I'm not sure whether LTO bootstrap worked before > > I didn't have bootstrap issues myself but I only tried my usual x86_64, not > other targets (which I test less often). But the patch regtests fine for me. LTO bootstrap also succeeded. I've pushed the patch. Richard. > Thanks. > > > but hopefully this > > would have fixed it. Testing non-LTO to be able to push it anyway as > > well. > > > > Richard. > > > > PR lto/121935 > > * ipa-free-lang-data.cc (find_decls_types_r): Visit DECL_ARGUMENTS > > chain manually. > > > > * g++.dg/lto/pr121935_0.C: New testcase. > > --- > > gcc/ipa-free-lang-data.cc | 3 ++- > > gcc/testsuite/g++.dg/lto/pr121935_0.C | 13 +++++++++++++ > > 2 files changed, 15 insertions(+), 1 deletion(-) > > create mode 100644 gcc/testsuite/g++.dg/lto/pr121935_0.C > > > > diff --git a/gcc/ipa-free-lang-data.cc b/gcc/ipa-free-lang-data.cc > > index 41afc6ec82f..8196cab6079 100644 > > --- a/gcc/ipa-free-lang-data.cc > > +++ b/gcc/ipa-free-lang-data.cc > > @@ -735,7 +735,8 @@ find_decls_types_r (tree *tp, int *ws, void *data) > > > > if (TREE_CODE (t) == FUNCTION_DECL) > > { > > - fld_worklist_push (DECL_ARGUMENTS (t), fld); > > + for (tree arg = DECL_ARGUMENTS (t); arg; arg = DECL_CHAIN (arg)) > > + fld_worklist_push (arg, fld); > > fld_worklist_push (DECL_RESULT (t), fld); > > } > > else if (TREE_CODE (t) == FIELD_DECL) > > diff --git a/gcc/testsuite/g++.dg/lto/pr121935_0.C b/gcc/testsuite/g++.dg/lto/pr121935_0.C > > new file mode 100644 > > index 00000000000..a4519b1d3ad > > --- /dev/null > > +++ b/gcc/testsuite/g++.dg/lto/pr121935_0.C > > @@ -0,0 +1,13 @@ > > +// { dg-lto-do assemble } > > +// { dg-lto-options {{-flto -Wno-return-type}} } > > + > > +struct a { > > + static int b; > > +}; > > +template <int> struct c { > > + struct d { > > + d e(unsigned, unsigned, bool, bool, bool, unsigned, a); > > + }; > > +}; > > +template <> > > +c<2>::d c<2>::d::e(unsigned, unsigned, bool, bool, bool, unsigned, const a) { } >
diff --git a/gcc/ipa-free-lang-data.cc b/gcc/ipa-free-lang-data.cc index 41afc6ec82f..8196cab6079 100644 --- a/gcc/ipa-free-lang-data.cc +++ b/gcc/ipa-free-lang-data.cc @@ -735,7 +735,8 @@ find_decls_types_r (tree *tp, int *ws, void *data) if (TREE_CODE (t) == FUNCTION_DECL) { - fld_worklist_push (DECL_ARGUMENTS (t), fld); + for (tree arg = DECL_ARGUMENTS (t); arg; arg = DECL_CHAIN (arg)) + fld_worklist_push (arg, fld); fld_worklist_push (DECL_RESULT (t), fld); } else if (TREE_CODE (t) == FIELD_DECL) diff --git a/gcc/testsuite/g++.dg/lto/pr121935_0.C b/gcc/testsuite/g++.dg/lto/pr121935_0.C new file mode 100644 index 00000000000..a4519b1d3ad --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr121935_0.C @@ -0,0 +1,13 @@ +// { dg-lto-do assemble } +// { dg-lto-options {{-flto -Wno-return-type}} } + +struct a { + static int b; +}; +template <int> struct c { + struct d { + d e(unsigned, unsigned, bool, bool, bool, unsigned, a); + }; +}; +template <> +c<2>::d c<2>::d::e(unsigned, unsigned, bool, bool, bool, unsigned, const a) { }