diff mbox

[committed] Generate debug line info for thunks on hppa

Message ID BLU0-SMTP746F7898AAE57539B536BC97690@phx.gbl
State New
Headers show

Commit Message

John David Anglin April 6, 2014, 3:25 p.m. UTC
Previously, pa_asm_output_mi_thunk() internally output the assembler  
directives needed
for thunks.  This patch switches to using final_start_function() an  
final_end_function() to
generate these directives.  This has the advantage that these  
functions also ouput debug
info as well.  This fixes PR debug/55794.

Tested on hppa2.0w-hp-hpux11.11, hppa64-hp-hpux11.11 and hppa-unknown- 
linux-gnu.

Committed to trunk.

Dave
--
John David Anglin	dave.anglin@bell.net
2014-04-06  John David Anglin  <danglin@gcc.gnu.org>

	PR debug/55794
	* config/pa/pa.c (pa_output_function_epilogue): Skip address and code
	size accounting for thunks.
	(pa_asm_output_mi_thunk): Use final_start_function() and
	final_end_function() to output function start and end directives.
diff mbox

Patch

Index: config/pa/pa.c
===================================================================
--- config/pa/pa.c	(revision 209026)
+++ config/pa/pa.c	(working copy)
@@ -4187,13 +4187,17 @@ 
 
   if (TARGET_SOM && TARGET_GAS)
     {
-      /* We done with this subspace except possibly for some additional
+      /* We are done with this subspace except possibly for some additional
 	 debug information.  Forget that we are in this subspace to ensure
 	 that the next function is output in its own subspace.  */
       in_section = NULL;
       cfun->machine->in_nsubspa = 2;
     }
 
+  /* Thunks do their own accounting.  */
+  if (cfun->is_thunk)
+    return;
+
   if (INSN_ADDRESSES_SET_P ())
     {
       insn = get_last_nonnote_insn ();
@@ -8259,8 +8263,7 @@ 
   xoperands[1] = XEXP (DECL_RTL (thunk_fndecl), 0);
   xoperands[2] = GEN_INT (delta);
 
-  ASM_OUTPUT_LABEL (file, XSTR (xoperands[1], 0));
-  fprintf (file, "\t.PROC\n\t.CALLINFO FRAME=0,NO_CALLS\n\t.ENTRY\n");
+  final_start_function (emit_barrier (), file, 1);
 
   /* Output the thunk.  We know that the function is in the same
      translation unit (i.e., the same space) as the thunk, and that
@@ -8466,17 +8469,8 @@ 
 	}
     }
 
-  fprintf (file, "\t.EXIT\n\t.PROCEND\n");
+  final_end_function ();
 
-  if (TARGET_SOM && TARGET_GAS)
-    {
-      /* We done with this subspace except possibly for some additional
-	 debug information.  Forget that we are in this subspace to ensure
-	 that the next function is output in its own subspace.  */
-      in_section = NULL;
-      cfun->machine->in_nsubspa = 2;
-    }
-
   if (TARGET_SOM && flag_pic && TREE_PUBLIC (function))
     {
       switch_to_section (data_section);