diff mbox

PATCH: PR middle-end/54332: [4.8 Regression] 481.wrf in SPEC CPU 2006 takes > 10GB memory to compile

Message ID 20120821211005.GA28635@intel.com
State New
Headers show

Commit Message

H.J. Lu Aug. 21, 2012, 9:10 p.m. UTC
Hi,

This patch restores df_free_collection_rec call inside the insn traversal
loop and removes the stack allocation check in vec_reserve.  It has
been approved in

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54332#c25

It has been tested on Linux/x86-64 and checked in.

Thanks.


H.J.
---
2012-08-21  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/54332
	* df-scan.c (df_bb_verify): Restore df_free_collection_rec call
	inside the insn traversal loop.

	* vec.h (vec_reserve): Remove the stack allocation check.
diff mbox

Patch

diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 55492fa..df90365 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -4448,6 +4448,7 @@  df_bb_verify (basic_block bb)
       if (!INSN_P (insn))
         continue;
       df_insn_refs_verify (&collection_rec, bb, insn, true);
+      df_free_collection_rec (&collection_rec);
     }
 
   /* Do the artificial defs and uses.  */
diff --git a/gcc/vec.h b/gcc/vec.h
index 5fdb859..1922616 100644
--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -1099,21 +1099,9 @@  vec_reserve (vec_t<T> *vec_, int reserve MEM_STAT_DECL)
 					      sizeof (T), false
 					      PASS_MEM_STAT);
   else
-    {
-      /* Only allow stack vectors when re-growing them.  The initial
-	 allocation of stack vectors must be done with the
-	 VEC_stack_alloc macro, because it uses alloca() for the
-	 allocation.  */
-      if (vec_ == NULL)
-	{
-	  fprintf (stderr, "Stack vectors must be initially allocated "
-		   "with VEC_stack_alloc.\n");
-	  gcc_unreachable ();
-	}
-      return (vec_t<T> *) vec_stack_o_reserve (vec_, reserve,
-					       offsetof (vec_t<T>, vec),
-					       sizeof (T) PASS_MEM_STAT);
-    }
+    return (vec_t<T> *) vec_stack_o_reserve (vec_, reserve,
+					     offsetof (vec_t<T>, vec),
+					     sizeof (T) PASS_MEM_STAT);
 }