This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Bug bootstrap/14671] [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  <dave.anglin@nrc-cnrc.gc.ca>

	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;
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]