Commit ba3b3878 by Brendan Kehoe Committed by Brendan Kehoe

global.c (global_alloc): Use xmalloc instead of alloca for CONFLICTS...

	* global.c (global_alloc): Use xmalloc instead of alloca for
	CONFLICTS, since max_allocno * allocno_row_words alone can be more
	than 2.5Mb sometimes.

From-SVN: r16223
parent d540ae2c
1997-10-28 Brendan Kehoe <brendan@lisa.cygnus.com>
* global.c (global_alloc): Use xmalloc instead of alloca for
CONFLICTS, since max_allocno * allocno_row_words alone can be more
than 2.5Mb sometimes.
Tue Oct 28 15:29:15 1997 Richard Henderson <rth@cygnus.com> Tue Oct 28 15:29:15 1997 Richard Henderson <rth@cygnus.com>
* reload1.c (eliminate_regs [SET]): If [SUBREG] widened the mode of * reload1.c (eliminate_regs [SET]): If [SUBREG] widened the mode of
......
...@@ -486,8 +486,11 @@ global_alloc (file) ...@@ -486,8 +486,11 @@ global_alloc (file)
allocno_row_words = (max_allocno + INT_BITS - 1) / INT_BITS; allocno_row_words = (max_allocno + INT_BITS - 1) / INT_BITS;
conflicts = (INT_TYPE *) alloca (max_allocno * allocno_row_words /* We used to use alloca here, but the size of what it would try to
* sizeof (INT_TYPE)); allocate would occasionally cause it to exceed the stack limit and
cause unpredictable core dumps. Some examples were > 2Mb in size. */
conflicts = (INT_TYPE *) xmalloc (max_allocno * allocno_row_words
* sizeof (INT_TYPE));
bzero ((char *) conflicts, bzero ((char *) conflicts,
max_allocno * allocno_row_words * sizeof (INT_TYPE)); max_allocno * allocno_row_words * sizeof (INT_TYPE));
...@@ -570,6 +573,8 @@ global_alloc (file) ...@@ -570,6 +573,8 @@ global_alloc (file)
} }
} }
free (conflicts);
/* Do the reloads now while the allocno data still exist, so that we can /* Do the reloads now while the allocno data still exist, so that we can
try to assign new hard regs to any pseudo regs that are spilled. */ try to assign new hard regs to any pseudo regs that are spilled. */
......
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