]> git.ipfire.org Git - thirdparty/gcc.git/commit
lto/114501 - missed free-lang-data for CONSTRUCTOR index
authorRichard Biener <rguenther@suse.de>
Thu, 6 Mar 2025 12:48:16 +0000 (13:48 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 6 Mar 2025 14:26:57 +0000 (15:26 +0100)
commitfdd95e1cf29137a19baed25f8c817d320dfe63e3
tree3a8db55ce7f5e7768995ec6a4f470efb4920579a
parent780932620d859fa9e0190edd0c408d0bedf9179e
lto/114501 - missed free-lang-data for CONSTRUCTOR index

The following makes sure to also walk CONSTRUCTOR element indexes
which can be FIELD_DECLs, referencing otherwise unused types we
need to clean.  walk_tree only walks CONSTRUCTOR element data.

PR lto/114501
* ipa-free-lang-data.cc (find_decls_types_r): Explicitly
handle CONSTRUCTORs as walk_tree handling of those is
incomplete.

* g++.dg/pr114501_0.C: New testcase.
gcc/ipa-free-lang-data.cc
gcc/testsuite/g++.dg/pr114501_0.C [new file with mode: 0644]