diff options
author | Jakub Jelinek <jakub@redhat.com> | 2021-05-18 10:10:17 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2021-05-18 10:10:17 +0200 |
commit | 978b62e554ffb4b34844c72d259ce71fcbd87591 (patch) | |
tree | 672c357f4404ac10712d3b7df7d53af49463a3f0 /gcc/function.c | |
parent | 65061ea287a80cfb214e402cfd2373a14bfec95a (diff) | |
download | gcc-978b62e554ffb4b34844c72d259ce71fcbd87591.zip gcc-978b62e554ffb4b34844c72d259ce71fcbd87591.tar.gz gcc-978b62e554ffb4b34844c72d259ce71fcbd87591.tar.bz2 |
function: Set dummy DECL_ASSEMBLER_NAME in push_dummy_function [PR100580]
Last year I've added cgraph_node::get_create calls for the dummy
functions used for -fdump-passes, so that it interacts well with pass
disabling/enabling which is cgraph uid based.
Unfortunately, as the following testcase shows, when assembler hash
is present, that wants to compute DECL_ASSEMBLER_NAME and the C++ FE
is unprepared to handle it on the dummy functions which don't have
DECL_NAME etc.
The following patch fixes it by setting up a dummy DECL_ASSEMBLER_NAME
on these, so that the FEs don't need to compute it.
2021-05-18 Jakub Jelinek <jakub@redhat.com>
PR c++/100580
* function.c (push_dummy_function): Set DECL_ARTIFICIAL and
DECL_ASSEMBLER_NAME on the fn_decl.
* g++.dg/other/pr100580.C: New test.
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/function.c b/gcc/function.c index a3ed398..fc7b147 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -4930,6 +4930,9 @@ push_dummy_function (bool with_decl) fn_result_decl = build_decl (UNKNOWN_LOCATION, RESULT_DECL, NULL_TREE, void_type_node); DECL_RESULT (fn_decl) = fn_result_decl; + DECL_ARTIFICIAL (fn_decl) = 1; + tree fn_name = get_identifier (" "); + SET_DECL_ASSEMBLER_NAME (fn_decl, fn_name); } else fn_decl = NULL_TREE; |