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]

Change prescan parameter to final_scan_insn from -2 to 0 in arc.c


An inspection of the code of final_scan_insn shows that the values -2
and 0 for the prescan parameter are the same when HAVE_cc0 is not
defined.  Every test of prescan is of the form (prescan > 0) or
(prescan <= 0), except for one test guarded by #ifdef HAVE_cc0 which
tests (prescan >= 0).

The ARC backend does not define HAVE_cc0.  There is code in arc.c
which calls final_scan_insn with -2 for the prescan value.  This patch
changes it to use 0 instead.

If this is approved, I plan to submit a followup patch to eliminate
the prescan parameter entirely from final_scan_insn and final, as
after this patch, prescan will always have the value 0.

Tested by rebuilding a cross-compiler and thinking about it.  I don't
even know how to really test ARC code.  OK to commit?

Ian


2005-03-23  Ian Lance Taylor  <ian@airs.com>

	* config/arc/arc.c (arc_output_function_epilogue): Pass prescan as
	0 when calling final_scan_insn.


Index: config/arc/arc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arc/arc.c,v
retrieving revision 1.65
diff -u -p -r1.65 arc.c
--- config/arc/arc.c	18 Mar 2005 15:24:23 -0000	1.65
+++ config/arc/arc.c	23 Mar 2005 16:55:23 -0000
@@ -1347,7 +1347,7 @@ arc_output_function_epilogue (FILE *file
       /* ??? If stack intactness is important, always emit now.  */
       if (MUST_SAVE_RETURN_ADDR && epilogue_delay != NULL_RTX)
 	{
-	  final_scan_insn (XEXP (epilogue_delay, 0), file, 1, -2, 1, NULL);
+	  final_scan_insn (XEXP (epilogue_delay, 0), file, 1, 0, 1, NULL);
 	  epilogue_delay = NULL_RTX;
 	}
 
@@ -1379,7 +1379,7 @@ arc_output_function_epilogue (FILE *file
 	{
 	  if (epilogue_delay)
 	    {
-	      final_scan_insn (XEXP (epilogue_delay, 0), file, 1, -2, 1,
+	      final_scan_insn (XEXP (epilogue_delay, 0), file, 1, 0, 1,
 			       NULL);
 	    }
 	}
@@ -1405,7 +1405,7 @@ arc_output_function_epilogue (FILE *file
 	    abort ();
 	  if (restored < size)
 	    abort ();
-	  final_scan_insn (XEXP (epilogue_delay, 0), file, 1, -2, 1, NULL);
+	  final_scan_insn (XEXP (epilogue_delay, 0), file, 1, 0, 1, NULL);
 	}
       else if (frame_pointer_needed && !fp_restored_p)
 	{


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