$OpenBSD: pp-gcc_loop_c,v 1.1 2005/01/04 23:06:33 espie Exp $
--- gcc/loop.c.orig	Sun May 30 01:27:30 2004
+++ gcc/loop.c	Mon Jan  3 10:17:42 2005
@@ -1130,6 +1130,7 @@ scan_loop (loop, flags)
      Generally this increases code size, so do not move moveables when
      optimizing for code size.  */
 
+#ifndef	BROKEN_MOVE_MOVABLES_P
   if (! optimize_size)
     {
       move_movables (loop, movables, threshold, insn_count);
@@ -1150,6 +1151,7 @@ scan_loop (loop, flags)
 	  loop_max_reg = max_reg_num ();
 	}
     }
+#endif
 
   /* Now candidates that still are negative are those not moved.
      Change regs->array[I].set_in_loop to indicate that those are not actually
@@ -6553,6 +6555,14 @@ general_induction_var (loop, x, src_reg,
     *add_val = XEXP (*add_val, 0);
   if (GET_CODE (*mult_val) == USE)
     *mult_val = XEXP (*mult_val, 0);
+
+#ifndef FRAME_GROWS_DOWNWARD
+  if (flag_propolice_protection
+      && GET_CODE (*add_val) == PLUS
+      && (XEXP (*add_val, 0) == frame_pointer_rtx
+	  || XEXP (*add_val, 1) == frame_pointer_rtx))
+    return 0;
+#endif
 
   if (is_addr)
     *pbenefit += address_cost (orig_x, addr_mode) - reg_address_cost;
