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]

Small cleanup in reload_cse_regs


	* reload1.c (reg_values): Turn into an array.
	(reload_cse_regs): Don't allocate it.  Always clear it with bzero.
	Merge the two if statements that forget all register values.

Index: reload1.c
===================================================================
RCS file: /usr/local/cvs/gcs/gcc/reload1.c,v
retrieving revision 1.1.1.46
diff -u -p -r1.1.1.46 reload1.c
--- reload1.c	1998/10/08 14:53:25	1.1.1.46
+++ reload1.c	1998/10/12 10:56:29
@@ -419,11 +419,11 @@ static void reload_cse_check_clobber	PRO
 static void reload_cse_record_set	PROTO((rtx, rtx));
 static void reload_cse_delete_death_notes	PROTO((rtx));
 static void reload_cse_no_longer_dead	PROTO((int, enum machine_mode));
-static void reload_combine PROTO((void));
-static void reload_combine_note_use PROTO((rtx *, rtx));
-static void reload_combine_note_store PROTO((rtx, rtx));
-static void reload_cse_move2add PROTO((rtx));
-static void move2add_note_store PROTO((rtx, rtx));
+static void reload_combine		PROTO((void));
+static void reload_combine_note_use	PROTO((rtx *, rtx));
+static void reload_combine_note_store	PROTO((rtx, rtx));
+static void reload_cse_move2add		PROTO((rtx));
+static void move2add_note_store		PROTO((rtx, rtx));
 
 /* Initialize the reload pass once per compilation.  */
 
@@ -8030,7 +8030,7 @@ count_occurrences (x, find)
    We sometimes clobber a specific entry in a list.  In that case, we
    just set XEXP (list-entry, 0) to 0.  */
 
-static rtx *reg_values;
+static rtx reg_values[FIRST_PSEUDO_REGISTER];
 
 /* This is a preallocated REG rtx which we use as a temporary in
    reload_cse_invalidate_regno, so that we don't need to allocate a
@@ -8295,7 +8295,6 @@ reload_cse_no_longer_dead (regno, mode)
     }
 }
 
-
 /* Do a very simple CSE pass over the hard registers.
 
    This function detects no-op moves where we happened to assign two
@@ -8324,8 +8323,7 @@ reload_cse_regs_1 (first)
 
   init_alias_analysis ();
 
-  reg_values = (rtx *) alloca (FIRST_PSEUDO_REGISTER * sizeof (rtx));
-  bzero ((char *)reg_values, FIRST_PSEUDO_REGISTER * sizeof (rtx));
+  bzero ((char *)reg_values, sizeof reg_values);
 
   /* Create our EXPR_LIST structures on reload_obstack, so that we can
      free them when we are done.  */
@@ -8344,26 +8342,18 @@ reload_cse_regs_1 (first)
     {
       rtx body;
 
-      if (GET_CODE (insn) == CODE_LABEL)
+      if (GET_CODE (insn) == CODE_LABEL
+#ifdef NON_SAVING_SETJMP 
+	  || (NON_SAVING_SETJMP && GET_CODE (insn) == NOTE
+	      && NOTE_LINE_NUMBER (insn) == NOTE_INSN_SETJMP)
+#endif
+	  )
 	{
 	  /* Forget all the register values at a code label.  We don't
              try to do anything clever around jumps.  */
-	  for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
-	    reg_values[i] = 0;
-
+	  bzero ((char *)reg_values, sizeof reg_values);
 	  continue;
 	}
-
-#ifdef NON_SAVING_SETJMP 
-      if (NON_SAVING_SETJMP && GET_CODE (insn) == NOTE
-	  && NOTE_LINE_NUMBER (insn) == NOTE_INSN_SETJMP)
-	{
-	  for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
-	    reg_values[i] = 0;
-
-	  continue;
-	}
-#endif
 
       if (GET_RTX_CLASS (GET_CODE (insn)) != 'i')
 	continue;



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