aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2025-09-14 11:01:11 +0200
committerRichard Biener <rguenther@suse.de>2025-09-14 13:24:48 +0200
commit38666cbccff5114e2f23930fae180f03c385eb45 (patch)
tree2cf690de94dd033062e37b8f32dda02131976f2e
parentaf53cfeb8352b18cbc0684f04c5106db20142f7b (diff)
downloadgcc-38666cbccff5114e2f23930fae180f03c385eb45.zip
gcc-38666cbccff5114e2f23930fae180f03c385eb45.tar.gz
gcc-38666cbccff5114e2f23930fae180f03c385eb45.tar.bz2
lto/121935 - visit all DECL_ARGUMENTS in free-lang-dataHEADtrunkmaster
With no longer visiting TREE_CHAIN for decls we have to visit the DECL_ARGUMENT chain manually. 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.
-rw-r--r--gcc/ipa-free-lang-data.cc3
-rw-r--r--gcc/testsuite/g++.dg/lto/pr121935_0.C13
2 files changed, 15 insertions, 1 deletions
diff --git a/gcc/ipa-free-lang-data.cc b/gcc/ipa-free-lang-data.cc
index 41afc6e..8196cab 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 0000000..a4519b1
--- /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) { }