From 32c7c682342b4f4a0cd2eb4a7c3ad0c32b60e872 Mon Sep 17 00:00:00 2001 From: jakub Date: Thu, 8 Nov 2012 20:15:06 +0000 Subject: PR debug/54499 * cgraphunit.c (assemble_thunk): Don't call source_line debug hook here, instead call insn_locations_{init,finalize} and initialize prologue_location. * g++.dg/debug/pr54499.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193338 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/cgraphunit.c | 8 ++++---- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/debug/pr54499.C | 22 ++++++++++++++++++++++ 4 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/g++.dg/debug/pr54499.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 17308440153..c06016ce7aa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2012-11-08 Jakub Jelinek + + PR debug/54499 + * cgraphunit.c (assemble_thunk): Don't call source_line debug hook + here, instead call insn_locations_{init,finalize} and initialize + prologue_location. + 2012-11-08 Dmitry Gorbachev PR driver/54789 diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index bf1326bbb88..e14e52ed668 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1413,16 +1413,16 @@ assemble_thunk (struct cgraph_node *node) DECL_INITIAL (thunk_fndecl) = fn_block; init_function_start (thunk_fndecl); cfun->is_thunk = 1; + insn_locations_init (); + set_curr_insn_location (DECL_SOURCE_LOCATION (thunk_fndecl)); + prologue_location = curr_insn_location (); assemble_start_function (thunk_fndecl, fnname); - (*debug_hooks->source_line) (DECL_SOURCE_LINE (thunk_fndecl), - DECL_SOURCE_FILE (thunk_fndecl), - /* discriminator */ 0, - /* is_stmt */ 1); targetm.asm_out.output_mi_thunk (asm_out_file, thunk_fndecl, fixed_offset, virtual_value, alias); assemble_end_function (thunk_fndecl, fnname); + insn_locations_finalize (); init_insn_lengths (); free_after_compilation (cfun); set_cfun (NULL); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e9d319bb754..a93996cc748 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-11-08 Jakub Jelinek + + PR debug/54499 + * g++.dg/debug/pr54499.C: New test. + 2012-11-08 Jan Hubicka PR middle-end/48636 diff --git a/gcc/testsuite/g++.dg/debug/pr54499.C b/gcc/testsuite/g++.dg/debug/pr54499.C new file mode 100644 index 00000000000..0f7ce3f2e90 --- /dev/null +++ b/gcc/testsuite/g++.dg/debug/pr54499.C @@ -0,0 +1,22 @@ +// PR debug/54499 +// { dg-do assemble } + +struct S1 +{ + virtual void f () = 0; +}; + +struct S2 +{ + virtual ~S2 () { } +}; + +struct S3 : public S1, public S2 +{ + void f (); +}; + +void +S3::f () +{ +} -- cgit v1.2.1