$OpenBSD: patch-gcc_config_alpha_alpha_c,v 1.3 2012/03/31 20:02:03 pascal Exp $
--- gcc/config/alpha/alpha.c.orig	Sat Aug  6 20:41:14 2011
+++ gcc/config/alpha/alpha.c	Mon Mar 12 08:44:40 2012
@@ -227,6 +227,10 @@ alpha_handle_option (size_t code, const char *arg, int
       target_flags |= MASK_IEEE_CONFORMANT;
       break;
 
+    case OPT_mno_ieee:
+      target_flags &= ~(MASK_IEEE_WITH_INEXACT|MASK_IEEE_CONFORMANT);
+      break;
+
     case OPT_mtls_size_:
       if (value != 16 && value != 32 && value != 64)
 	error ("bad value %qs for -mtls-size switch", arg);
@@ -487,11 +491,17 @@ alpha_option_override (void)
   if (!global_options_set.x_g_switch_value)
     g_switch_value = 8;
 
+#ifdef OPENBSD_NATIVE
+  /* Make -fpic behave as -fPIC unless -msmall-data is specified. */
+  if (flag_pic == 2 && TARGET_SMALL_DATA)
+    warning (0, "-fPIC used with -msmall-data");
+#else
   /* Infer TARGET_SMALL_DATA from -fpic/-fPIC.  */
   if (flag_pic == 1)
     target_flags |= MASK_SMALL_DATA;
   else if (flag_pic == 2)
     target_flags &= ~MASK_SMALL_DATA;
+#endif
 
   /* Align labels and loops for optimal branching.  */
   /* ??? Kludge these by not doing anything if we don't optimize and also if
@@ -7803,6 +7813,9 @@ alpha_expand_prologue (void)
   sa_size = alpha_sa_size ();
   frame_size = compute_frame_size (get_frame_size (), sa_size);
 
+  if (warn_stack_larger_than && frame_size > stack_larger_than_size)
+    warning (OPT_Wstack_larger_than_, "stack usage is %d bytes", frame_size);
+
   if (flag_stack_usage)
     current_function_static_stack_size = frame_size;
 
@@ -7844,6 +7857,8 @@ alpha_expand_prologue (void)
   if (flag_stack_check)
     probed_size += STACK_CHECK_PROTECT;
 
+if (flag_stack_check || STACK_CHECK_BUILTIN)
+  {
   if (probed_size <= 32768)
     {
       if (probed_size > 4096)
@@ -7937,6 +7952,44 @@ alpha_expand_prologue (void)
 							? -frame_size + 64
 							: -frame_size))));
     }
+    }
+  else
+    {
+      if (frame_size <= 32768)
+	{
+	  if (frame_size != 0)
+	    FRP (emit_insn (gen_adddi3 (stack_pointer_rtx, stack_pointer_rtx,
+					GEN_INT (TARGET_ABI_UNICOSMK
+						 ? -frame_size + 64
+						 : -frame_size))));
+	}
+      else
+	{
+	  rtx count = gen_rtx_REG (DImode, 23);
+	  rtx seq;
+ 
+	  emit_move_insn (count, GEN_INT (TARGET_ABI_UNICOSMK
+					  ? -frame_size + 64
+					  : -frame_size));
+	  seq = emit_insn (gen_adddi3 (stack_pointer_rtx, stack_pointer_rtx,
+				       count));
+ 
+	  /* This alternative is special, because the DWARF code cannot
+	     possibly intuit through the loop above.  So we invent this
+	     note it looks at instead.  */
+	  RTX_FRAME_RELATED_P (seq) = 1;
+	  REG_NOTES (seq)
+	    = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR,
+				 gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+				   gen_rtx_PLUS (Pmode, stack_pointer_rtx,
+						 GEN_INT (TARGET_ABI_UNICOSMK
+							  ? -frame_size + 64
+							  : -frame_size))),
+				 REG_NOTES (seq));
+	}
+    }
+
+
 
   if (!TARGET_ABI_UNICOSMK)
     {
