From: Brendan Kehoe Date: Tue, 28 Oct 1997 23:39:28 +0000 (+0000) Subject: global.c (global_alloc): Use xmalloc instead of alloca for CONFLICTS... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ba3b38784c486a363d676df2543be51d0eb357a0;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 39a753d0f16..182a76e1ef6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +1997-10-28 Brendan Kehoe + + * 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 * reload1.c (eliminate_regs [SET]): If [SUBREG] widened the mode of diff --git a/gcc/global.c b/gcc/global.c index 83b09fe431f..0480ebf3c4d 100644 --- a/gcc/global.c +++ b/gcc/global.c @@ -486,8 +486,11 @@ global_alloc (file) allocno_row_words = (max_allocno + INT_BITS - 1) / INT_BITS; - conflicts = (INT_TYPE *) alloca (max_allocno * allocno_row_words - * sizeof (INT_TYPE)); + /* We used to use alloca here, but the size of what it would try to + 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, max_allocno * allocno_row_words * sizeof (INT_TYPE)); @@ -570,6 +573,8 @@ global_alloc (file) } } + free (conflicts); + /* 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. */