aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2022-02-09 15:17:52 +0100
committerJakub Jelinek <jakub@redhat.com>2022-02-09 15:17:52 +0100
commitbe9cd0ca8a5f13cfee6a39b217d439a25c53553a (patch)
treedf128b7a16483ac0fad48cf82c9ffde9dbaa93c0 /gcc/c
parentc6bb1db76b3ac127aff7dacf391fc1798a94bb7d (diff)
downloadgcc-be9cd0ca8a5f13cfee6a39b217d439a25c53553a.zip
gcc-be9cd0ca8a5f13cfee6a39b217d439a25c53553a.tar.gz
gcc-be9cd0ca8a5f13cfee6a39b217d439a25c53553a.tar.bz2
dwarf2out: Don't call expand_expr during early_dwarf [PR104407]
As mentioned in the PR, since PR96690 r11-2834 we call rtl_for_decl_init which can call expand_expr already during early_dwarf. The comment and PR explains it that the intent is to ensure the referenced vars and functions are properly mangled because free_lang_data doesn't cover everything, like template parameters etc. It doesn't work well though, because expand_expr can set DECL_RTLs e.g. on referenced vars and keep them there, and they can be created e.g. with different MEM_ALIGN compared to what they would be created with if they were emitted later. So, the following patch stops calling rtl_for_decl_init and instead for cases for which rtl_for_decl_init does anything at all walks the initializer and ensures referenced vars or functions are mangled. 2022-02-09 Jakub Jelinek <jakub@redhat.com> PR debug/104407 * dwarf2out.cc (mangle_referenced_decls): New function. (tree_add_const_value_attribute): Don't call rtl_for_decl_init if early_dwarf. Instead walk the initializer and try to mangle vars or functions referenced from it. * g++.dg/debug/dwarf2/pr104407.C: New test.
Diffstat (limited to 'gcc/c')
0 files changed, 0 insertions, 0 deletions