sparc.h (CAN_ELMINIATE): Can only eliminate FP in favor of SP if FRAME_POINTER_REQUIR...
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Tue, 19 Mar 2002 19:33:42 +0000 (19:33 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Tue, 19 Mar 2002 19:33:42 +0000 (14:33 -0500)
* config/sparc/sparc.h (CAN_ELMINIATE): Can only eliminate FP
in favor of SP if FRAME_POINTER_REQUIRED is false.

From-SVN: r51032

gcc/ChangeLog
gcc/config/sparc/sparc.h

index fbaee55..58f6ea9 100644 (file)
@@ -1,3 +1,8 @@
+Tue Mar 19 14:12:32 2002  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       * config/sparc/sparc.h (CAN_ELMINIATE): Can only eliminate FP
+       in favor of SP if FRAME_POINTER_REQUIRED is false.
+
 2002-03-19  Lars Brinkhoff  <lars@nocrew.org>
 
        * emit-rtl.c (gen_int_mode): New function.
index e765973..89f5e07 100644 (file)
@@ -1570,7 +1570,12 @@ extern const char leaf_reg_remap[];
   {{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
    { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM} }
 
-#define CAN_ELIMINATE(FROM, TO) 1
+/* The way this is structured, we can't eliminate SFP in favor of SP
+   if the frame pointer is required: we want to use the SFP->HFP elimination
+   in that case.  But the test in update_eliminables doesn't know we are
+   assuming below that we only do the former elimination.  */
+#define CAN_ELIMINATE(FROM, TO) \
+  ((TO) == HARD_FRAME_POINTER_REGNUM || !FRAME_POINTER_REQUIRED)
 
 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
   do {                                                         \