$OpenBSD: patch-gcc_config_i386_i386_c,v 1.5 2017/06/07 23:34:02 brynet Exp $
--- gcc/config/i386/i386.c.orig	Mon Aug  1 12:03:41 2016
+++ gcc/config/i386/i386.c	Sun Jun  4 04:30:01 2017
@@ -2307,6 +2307,8 @@ struct ix86_frame
   HOST_WIDE_INT reg_save_offset;
   HOST_WIDE_INT sse_reg_save_offset;
 
+  HOST_WIDE_INT local_size;
+
   /* When save_regs_using_mov is set, emit prologue using
      move instead of push instructions.  */
   bool save_regs_using_mov;
@@ -9527,6 +9529,7 @@ ix86_compute_frame_layout (struct ix86_frame *frame)
   HOST_WIDE_INT size = get_frame_size ();
   HOST_WIDE_INT to_allocate;
 
+  frame->local_size = size;
   frame->nregs = ix86_nsaved_regs ();
   frame->nsseregs = ix86_nsaved_sseregs ();
 
@@ -10904,6 +10907,9 @@ ix86_expand_prologue (void)
       m->fs.realigned = true;
     }
 
+  if (warn_stack_larger_than && frame.local_size > stack_larger_than_size)
+    warning (OPT_Wstack_larger_than_, "stack usage is %ld bytes", frame.local_size);
+
   int_registers_saved = (frame.nregs == 0);
   sse_registers_saved = (frame.nsseregs == 0);
 
@@ -26860,7 +26866,7 @@ ix86_local_alignment (tree exp, enum machine_mode mode
 		   != TYPE_MAIN_VARIANT (va_list_type_node)))
 	   && TYPE_SIZE (type)
 	   && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
-	   && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 16
+	   && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 128
 	       || TREE_INT_CST_HIGH (TYPE_SIZE (type))) && align < 128)
 	return 128;
     }
