aboutsummaryrefslogtreecommitdiff
path: root/gcc/final.c
diff options
context:
space:
mode:
authorPierre-Marie de Rodat <derodat@adacore.com>2015-12-02 15:57:34 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2015-12-02 15:57:34 +0000
commitf2834b5d870fb769b4156ab4b35809e4fd613ae0 (patch)
treea32dc57ea24048ca49e8b206953e1025378e8dc7 /gcc/final.c
parentff7a55bf56a6f148b29c8fd44ca90c4e535fc2bd (diff)
downloadgcc-f2834b5d870fb769b4156ab4b35809e4fd613ae0.zip
gcc-f2834b5d870fb769b4156ab4b35809e4fd613ae0.tar.gz
gcc-f2834b5d870fb769b4156ab4b35809e4fd613ae0.tar.bz2
Track indirect calls for call site information in debug info
gcc/ChangeLog: * dwarf2out.c (dwar2out_var_location): In addition to notes, process indirect calls whose target is compile-time known. Enhance pattern matching to get the SYMBOL_REF they embed. (gen_subprogram_die): Handle such calls. * final.c (final_scan_insn): For call instructions, invoke the var_location debug hook only after the call has been emitted. From-SVN: r231185
Diffstat (limited to 'gcc/final.c')
-rw-r--r--gcc/final.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/final.c b/gcc/final.c
index 2f57b1b..8cb5533 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -2995,7 +2995,8 @@ final_scan_insn (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED,
&& targetm.asm_out.unwind_emit)
targetm.asm_out.unwind_emit (asm_out_file, insn);
- if (rtx_call_insn *call_insn = dyn_cast <rtx_call_insn *> (insn))
+ rtx_call_insn *call_insn = dyn_cast <rtx_call_insn *> (insn);
+ if (call_insn != NULL)
{
rtx x = call_from_call_insn (call_insn);
x = XEXP (x, 0);
@@ -3007,8 +3008,6 @@ final_scan_insn (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED,
if (t)
assemble_external (t);
}
- if (!DECL_IGNORED_P (current_function_decl))
- debug_hooks->var_location (insn);
}
/* Output assembler code from the template. */
@@ -3024,6 +3023,12 @@ final_scan_insn (rtx_insn *insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED,
&& targetm.asm_out.unwind_emit)
targetm.asm_out.unwind_emit (asm_out_file, insn);
+ /* Let the debug info back-end know about this call. We do this only
+ after the instruction has been emitted because labels that may be
+ created to reference the call instruction must appear after it. */
+ if (call_insn != NULL && !DECL_IGNORED_P (current_function_decl))
+ debug_hooks->var_location (insn);
+
current_output_insn = debug_insn = 0;
}
}