As mentioned in the PR, we don't guarantee DECL_UID to be the same between corresponding decls in -g and -g0 builds, -g can create more decls and all that is guaranteed is that the DECL_UIDs of the corresponding decls compare the same. The following testcase gets a -fcompare-debug failure because these functions use DECL_UID as the number in ASM_FORMAT_PRIVATE_NAME. The patch fixes it by using just a sequential number there instead. I don't think this can be called during PCH writing, this only happens for non-public decls and the C/C++ FEs shouldn't mangling those at that point (furthermore C++ FE uses a different set_decl_assembler_name hook and this one is something only the gimplifier calls on C.NNNN temporaries. 2020-03-25 Jakub Jelinek <jakub@redhat.com> PR c++/94223 * langhooks.c (lhd_set_decl_assembler_name): Use a static ulong counter instead of DECL_UID. * lto-lang.c (lto_set_decl_assembler_name): Use a static ulong counter instead of DECL_UID. * g++.dg/opt/pr94223.C: New test.
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
ChangeLog | Loading commit data... | |
Make-lang.in | Loading commit data... | |
common.c | Loading commit data... | |
common.h | Loading commit data... | |
config-lang.in | Loading commit data... | |
lang-specs.h | Loading commit data... | |
lang.opt | Loading commit data... | |
lto-common.c | Loading commit data... | |
lto-common.h | Loading commit data... | |
lto-dump.c | Loading commit data... | |
lto-lang.c | Loading commit data... | |
lto-object.c | Loading commit data... | |
lto-partition.c | Loading commit data... | |
lto-partition.h | Loading commit data... | |
lto-symtab.c | Loading commit data... | |
lto-symtab.h | Loading commit data... | |
lto-tree.h | Loading commit data... | |
lto.c | Loading commit data... | |
lto.h | Loading commit data... |