]> git.ipfire.org Git - thirdparty/gcc.git/commit
Prevent mixups of IDENTIFIER_TRANSPARENT_ALIAS and IDENTIFIER_INTERNAL_P better ...
authorNathaniel Shead <nathanieloshead@gmail.com>
Wed, 23 Jul 2025 23:41:00 +0000 (09:41 +1000)
committerNathaniel Shead <nathanieloshead@gmail.com>
Sun, 27 Jul 2025 00:07:15 +0000 (10:07 +1000)
commit4a8fd4a8ee3f83c330deb0dd494b27f66a748fb5
tree6cbe487029bf5106fff6eb52f603e59705e2d2c3
parent68ddec92d4066328c127fdaa28ccadf10a738446
Prevent mixups of IDENTIFIER_TRANSPARENT_ALIAS and IDENTIFIER_INTERNAL_P better [PR120855]

The assertion failure on ASM_OUTPUT_WEAKREF targets since my r16-1738
was caused because the 'TREE_CHAIN (id)' check in assemble_name_resolve
no longer implies that ID is a transparent alias, since internal
identifiers can have a TREE_CHAIN as well.

I still don't think it's possible for a transparent alias to be an
internal identifier in the sense added, so this patch simply constrains
the assertion better so that it doesn't fail spuriously.  I also added a
couple of other assertions to help validate this assumption.

PR middle-end/120855

gcc/ChangeLog:

* cgraphunit.cc (symbol_table::compile): Assert a transparent
alias is not an internal identifier.
* symtab.cc (symbol_table::change_decl_assembler_name):
Likewise.
* varasm.cc (assemble_name_resolve): Check for
IDENTIFIER_TRANSPARENT_ALIAS instead of just TREE_CHAIN.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/cgraphunit.cc
gcc/symtab.cc
gcc/varasm.cc