Patchwork : Fix call to end_prologue debug hook

login
register
mail settings
Submitter Tristan Gingold
Date May 15, 2012, 9:26 a.m.
Message ID <0F2FAA8B-7702-4D4F-BE29-76DDC0AD4FDD@adacore.com>
Download mbox | patch
Permalink /patch/159270/
State New
Headers show

Comments

Tristan Gingold - May 15, 2012, 9:26 a.m.
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  <gingold@adacore.com>

	* final.c (final_scan_insn): Move call to end_prologue debug hook
	to the NOTE_INSN_PROLOGUE_END.
Tristan Gingold - May 29, 2012, 9:08 a.m.
Ping for:

On May 15, 2012, at 11:26 AM, Tristan Gingold wrote:

> 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  <gingold@adacore.com>
> 
> 	* 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)
>            {
>
Jason Merrill - May 30, 2012, 6:05 p.m.
OK.

Jason

Patch

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)
            {