Commit 33283dad by Richard Guenther Committed by Richard Biener

re PR middle-end/43600 (Segmentation fault for large C file (24MB))

2010-03-31  Richard Guenther  <rguenther@suse.de>

	PR middle-end/43600
	* cgraphunit.c (cgraph_output_in_order): Do not allocate
	temporary data on stack.

From-SVN: r157867
parent 9bae1881
2010-03-31 Richard Guenther <rguenther@suse.de>
PR middle-end/43600
* cgraphunit.c (cgraph_output_in_order): Do not allocate
temporary data on stack.
2010-03-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> 2010-03-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* config/sparc/sysv4.h (PUSHSECTION_FORMAT): Remove undef. * config/sparc/sysv4.h (PUSHSECTION_FORMAT): Remove undef.
......
...@@ -1664,7 +1664,6 @@ static void ...@@ -1664,7 +1664,6 @@ static void
cgraph_output_in_order (void) cgraph_output_in_order (void)
{ {
int max; int max;
size_t size;
struct cgraph_order_sort *nodes; struct cgraph_order_sort *nodes;
int i; int i;
struct cgraph_node *pf; struct cgraph_node *pf;
...@@ -1672,9 +1671,7 @@ cgraph_output_in_order (void) ...@@ -1672,9 +1671,7 @@ cgraph_output_in_order (void)
struct cgraph_asm_node *pa; struct cgraph_asm_node *pa;
max = cgraph_order; max = cgraph_order;
size = max * sizeof (struct cgraph_order_sort); nodes = XCNEWVEC (struct cgraph_order_sort, max);
nodes = (struct cgraph_order_sort *) alloca (size);
memset (nodes, 0, size);
varpool_analyze_pending_decls (); varpool_analyze_pending_decls ();
...@@ -1741,6 +1738,7 @@ cgraph_output_in_order (void) ...@@ -1741,6 +1738,7 @@ cgraph_output_in_order (void)
} }
cgraph_asm_nodes = NULL; cgraph_asm_nodes = NULL;
free (nodes);
} }
/* Return true when function body of DECL still needs to be kept around /* Return true when function body of DECL still needs to be kept around
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment