From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31828 invoked by alias); 28 May 2004 01:34:09 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 31799 invoked by alias); 28 May 2004 01:34:07 -0000 Date: Fri, 28 May 2004 18:58:00 -0000 Message-ID: <20040528013407.31795.qmail@sourceware.org> From: "dave at hiauly1 dot hia dot nrc dot ca" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040321182857.14671.danglin@gcc.gnu.org> References: <20040321182857.14671.danglin@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug bootstrap/14671] [3.3/3.4 regression] caller-save.c:491: internal compiler error: Segmentation fault X-Bugzilla-Reason: CC X-SW-Source: 2004-05/txt/msg03352.txt.bz2 List-Id: ------- Additional Comments From dave at hiauly1 dot hia dot nrc dot ca 2004-05-28 01:34 ------- Subject: Re: [3.3/3.4 regression] caller-save.c:491: int > | This appears to be because alias_invariant was not GC allocated. I > | think the patch that I posted earlier today will fix this. It's basically > | the same as that applied to the trunk except that in 3.3 the arrays are > | over allocated to allow for expansion during loop_optimize. > > Thanks for the additional information. Please could you give me a > link to the patch that you proposed for 3.3.x? Thanks. Here is the patch that I propose. It uses ggc_alloc_cleared because the multiplication is already done in init_alias_analysis. I have added the "rtx *" cast for K&R compatibility. I have built the testcase provided with PR15660 and the current version of the pooma-2.4.0 with -O2 -funroll-loops. However, the triggering of collection probably depends on the amount of memory in the test machine. So, Richard should test the patch and see if it resolves his PR. I've done a complete bootstrap with no regressions on hppa-unknown-linux-gnu. A full build of all languages except treelang has just completed on i686-pc-linux-gnu. I will start a check. A similar fix is needed for 3.4. Dave -- J. David Anglin dave.anglin@nrc-cnrc.gc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6602) 2004-05-27 John David Anglin PR bootstrap/14671 * alias.c (init_alias_analysis): Allocate alias_invariant array with ggc_alloc_cleared instead of xrealloc. (end_alias_analysis): Don't free alias_invariant. Index: alias.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/alias.c,v retrieving revision 1.181.2.5 diff -u -3 -p -r1.181.2.5 alias.c --- alias.c 8 May 2004 21:52:42 -0000 1.181.2.5 +++ alias.c 27 May 2004 21:07:12 -0000 @@ -2786,10 +2786,8 @@ init_alias_analysis () reg_seen = (char *) xmalloc (reg_base_value_size); if (! reload_completed && flag_unroll_loops) { - /* ??? Why are we realloc'ing if we're just going to zero it? */ - alias_invariant = (rtx *)xrealloc (alias_invariant, - reg_base_value_size * sizeof (rtx)); - memset ((char *)alias_invariant, 0, reg_base_value_size * sizeof (rtx)); + alias_invariant = (rtx *) ggc_alloc_cleared (reg_base_value_size + * sizeof (rtx)); alias_invariant_size = reg_base_value_size; } @@ -2985,7 +2983,6 @@ end_alias_analysis () reg_base_value_size = 0; if (alias_invariant) { - free (alias_invariant); alias_invariant = 0; alias_invariant_size = 0; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14671