+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.
{{ 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 { \