aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-03-31 13:20:19 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-03-31 13:20:19 +0000
commit33283dadd3a8ea2e7104f4e7a43bd70b4e96090c (patch)
tree5636d3cce792660f6ba0beee607c2158181f9c04
parent9bae1881eb12e60da5c8e0412bfe3ea717dc618d (diff)
downloadgcc-33283dadd3a8ea2e7104f4e7a43bd70b4e96090c.zip
gcc-33283dadd3a8ea2e7104f4e7a43bd70b4e96090c.tar.gz
gcc-33283dadd3a8ea2e7104f4e7a43bd70b4e96090c.tar.bz2
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
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/cgraphunit.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8d7b219..6515701 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+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>
* config/sparc/sysv4.h (PUSHSECTION_FORMAT): Remove undef.
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 185fc53..212ab3a 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -1664,7 +1664,6 @@ static void
cgraph_output_in_order (void)
{
int max;
- size_t size;
struct cgraph_order_sort *nodes;
int i;
struct cgraph_node *pf;
@@ -1672,9 +1671,7 @@ cgraph_output_in_order (void)
struct cgraph_asm_node *pa;
max = cgraph_order;
- size = max * sizeof (struct cgraph_order_sort);
- nodes = (struct cgraph_order_sort *) alloca (size);
- memset (nodes, 0, size);
+ nodes = XCNEWVEC (struct cgraph_order_sort, max);
varpool_analyze_pending_decls ();
@@ -1741,6 +1738,7 @@ cgraph_output_in_order (void)
}
cgraph_asm_nodes = NULL;
+ free (nodes);
}
/* Return true when function body of DECL still needs to be kept around