This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RS6000] PR 40473, parameter debug location lists


This patch fixes a problem with debug location lists for function
parameters.  When using the powerpc -mno-sched-epilog option, the
lists don't cover the prologue.  -mno-sched-epilog stops function
prologue scheduling as well as epilogue, and does so by emitting the
function prologue/epilogue very late in the compilation process.  The
prologue insns so emitted are located before the "start of function"
as seen by the rest of the compiler, which confuses variable
tracking.  The fix is to simply emit the prologue instructions after
the correct label.

Bootstrapped and regression tested powerpc-linux.  Bootstrapped also
with BOOT_CFLAGS="-g -O2 -mno-sched-epilog".  OK mainline and
branches?

	PR target/40473
	* config/rs6000/rs6000.c (rs6000_output_function_prologue): Don't
	call final to emit non-scheduled prologue, instead insert at entry.

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 151837)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -19107,6 +19107,8 @@ rs6000_output_function_prologue (FILE *f
 
   if (! HAVE_prologue)
     {
+      rtx prologue;
+
       start_sequence ();
 
       /* A NOTE_INSN_DELETED is supposed to be at the start and end of
@@ -19126,10 +19128,14 @@ rs6000_output_function_prologue (FILE *f
 	  }
       }
 
-      if (TARGET_DEBUG_STACK)
-	debug_rtx_list (get_insns (), 100);
-      final (get_insns (), file, FALSE);
+      prologue = get_insns ();
       end_sequence ();
+
+      if (TARGET_DEBUG_STACK)
+	debug_rtx_list (prologue, 100);
+
+      emit_insn_before_noloc (prologue, BB_HEAD (ENTRY_BLOCK_PTR->next_bb),
+			      ENTRY_BLOCK_PTR);
     }
 
   rs6000_pic_labelno++;

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]