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]

Another possible problem with the gcc2 merge


The recent gcc2 merge made addr_affects_sp conditional on AUTO_INC_DEC.
If this change is safe, I fail to see why.  Even on machines that don't
define AUTO_INC_DEC, e.g. the i386, we can have stack pushes that use
autoinc addressing modes.
The patch below undoes this change.

Bernd

        * cse.c (addr_affects_sp): No longer conditional on AUTO_INC_DEC.
	(invalidate_skipped_set): Call it unconditionally.
	(cse_set_around_loop): Likewise.

Index: cse.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cse.c,v
retrieving revision 1.110
diff -u -p -r1.110 cse.c
--- cse.c	1999/11/08 04:56:17	1.110
+++ cse.c	1999/11/12 13:12:54
@@ -693,9 +693,7 @@ static void record_jump_equiv	PROTO((rtx
 static void record_jump_cond	PROTO((enum rtx_code, enum machine_mode,
 				       rtx, rtx, int));
 static void cse_insn		PROTO((rtx, rtx));
-#ifdef AUTO_INC_DEC
 static int addr_affects_sp_p	PROTO((rtx));
-#endif
 static void invalidate_from_clobbers PROTO((rtx));
 static rtx cse_process_notes	PROTO((rtx, rtx));
 static void cse_around_loop	PROTO((rtx));
@@ -6180,8 +6178,6 @@ invalidate_memory ()
       }
 }
 
-#ifdef AUTO_INC_DEC
-
 /* If ADDR is an address that implicitly affects the stack pointer, return
    1 and update the register tables to show the effect.  Else, return 0.  */
 
@@ -6206,7 +6202,6 @@ addr_affects_sp_p (addr)
 
   return 0;
 }
-#endif
 
 /* Perform invalidation on the basis of everything about an insn
    except for invalidating the actual places that are SET in it.
@@ -6431,9 +6426,7 @@ invalidate_skipped_set (dest, set, data)
   enum rtx_code code = GET_CODE (dest);
 
   if (code == MEM
-#ifdef AUTO_INC_DEC
       && ! addr_affects_sp_p (dest)	/* If this is not a stack push ... */
-#endif
       /* There are times when an address can appear varying and be a PLUS
 	 during this scan when it would be a fixed address were we to know
 	 the proper equivalences.  So invalidate all memory if there is
@@ -6606,10 +6599,8 @@ cse_set_around_loop (x, insn, loop_start
 	    }
     }
 
-#ifdef AUTO_INC_DEC
   /* Deal with the destination of X affecting the stack pointer.  */
   addr_affects_sp_p (SET_DEST (x));
-#endif
 
   /* See comment on similar code in cse_insn for explanation of these
      tests.  */


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