diff options
author | Jason Merrill <jason@redhat.com> | 2015-02-25 10:49:34 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2015-02-25 10:49:34 -0500 |
commit | 9b276dada87bb74d9dd7eff4e9aea26f45acacbe (patch) | |
tree | a06de8365104a2b091218817344eb25b8280d3e6 | |
parent | f66172c410cccc9d6d0ff2b96f836fde9cb0b1cb (diff) | |
download | gcc-9b276dada87bb74d9dd7eff4e9aea26f45acacbe.zip gcc-9b276dada87bb74d9dd7eff4e9aea26f45acacbe.tar.gz gcc-9b276dada87bb74d9dd7eff4e9aea26f45acacbe.tar.bz2 |
re PR debug/58315 (Excessive memory use with -g)
PR debug/58315
* decl.c (start_preparsed_function): Use create_artificial_label
for cdtor_label.
From-SVN: r220974
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/tree-ssa/deleted-label1.C | 19 |
3 files changed, 26 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 115a9f3..fbebe8e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2015-02-25 Jason Merrill <jason@redhat.com> + + PR debug/58315 + * decl.c (start_preparsed_function): Use create_artificial_label + for cdtor_label. + 2015-02-17 Paolo Carlini <paolo.carlini@oracle.com> Jakub Jelinek <jakub@redhat.com> diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 67c5ae7..83e060b 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -13721,9 +13721,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags) || (DECL_CONSTRUCTOR_P (decl1) && targetm.cxx.cdtor_returns_this ())) { - cdtor_label = build_decl (input_location, - LABEL_DECL, NULL_TREE, void_type_node); - DECL_CONTEXT (cdtor_label) = current_function_decl; + cdtor_label = create_artificial_label (input_location); } start_fname_decls (); diff --git a/gcc/testsuite/g++.dg/tree-ssa/deleted-label1.C b/gcc/testsuite/g++.dg/tree-ssa/deleted-label1.C new file mode 100644 index 0000000..11c06be --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-ssa/deleted-label1.C @@ -0,0 +1,19 @@ +// PR debug/58315 +// { dg-options "-O -g -fdump-tree-einline" } +// { dg-final { scan-tree-dump-not "DEBUG <L0>" "einline" } } +// { dg-final { cleanup-tree-dump "einline" } } + +// We used to emit useless NOTE_INSN_DELETED_DEBUG_LABELs for the +// artificial cdtor_label. + +struct A +{ + ~A() {} +}; + +struct B: A {}; + +int main() +{ + A a; +} |