Hi,
the end_prologue debug hook (only used by dwarf on VMS) is currently called at
the NOTE_INSN_FUNCTION_BEG. This is not what its name implies, neither what
the VMS debugger expect and neither what a comment in dwarf2out.c says:
/* Recall that this end-of-prologue indication is *not* the same thing
as the end_prologue debug hook. The NOTE_INSN_PROLOGUE_END note,
to which the hook corresponds, follows the last insn that was
emitted by gen_prologue. What we need is to preceed the first insn
that had been emitted after NOTE_INSN_FUNCTION_BEG, i.e. the first
insn that corresponds to something the user wrote. These may be
very different locations once scheduling is enabled. */
This is fixed by this patch.
No regressions on x86_64 GNU/Linux.
Ok for trunk ?
Tristan.
2012-05-15 Tristan Gingold <[email protected]>
* final.c (final_scan_insn): Move call to end_prologue debug hook
to the NOTE_INSN_PROLOGUE_END.
diff --git a/gcc/final.c b/gcc/final.c
index 718caf1..6efa06f 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -1961,6 +1961,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize_p ATTR
case NOTE_INSN_PROLOGUE_END:
targetm.asm_out.function_end_prologue (file);
profile_after_prologue (file);
+ if (!DECL_IGNORED_P (current_function_decl))
+ debug_hooks->end_prologue (last_linenum, last_filename);
if ((*seen & (SEEN_EMITTED | SEEN_NOTE)) == SEEN_NOTE)
{
@@ -1989,8 +1991,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize_p ATTR
case NOTE_INSN_FUNCTION_BEG:
app_disable ();
- if (!DECL_IGNORED_P (current_function_decl))
- debug_hooks->end_prologue (last_linenum, last_filename);
if ((*seen & (SEEN_EMITTED | SEEN_NOTE)) == SEEN_NOTE)
{