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: coalesce SSA versions in var-tracking notes


On Fri, Aug 18, 2006 at 09:50:48AM -0700, H. J. Lu wrote:
> On Fri, Aug 18, 2006 at 06:08:07PM +0200, Paolo Bonzini wrote:
> > 
> > >I plugged this patch in to my build last night but it failed to bootstrap:
> > >
> > >/proj/opensrc/nightly/src/trunk/gcc/var-tracking.c:1908: error: invalid 
> > >lvalue in unary '&'
> > >make[3]: *** [var-tracking.o] Error 1
> > >
> > >This is the line that caused the failure:
> > >
> > >  static FILE **var_tracking_debug_out __attribute__ ((__used__)) = 
> > >  &stderr;
> > >
> > >I was bootstrapping starting with a 4.0.2 GCC, perhaps that GCC doen't
> > >understand the __used__ attribute?
> > >  
> > Whether you can or cannot take the address of std{in,out,err} depends on 
> > the runtime library.
> > 
> > ISTR that Alex posted two patches, only one of which is really the fix 
> > for the bootstrapping failure.
> > 
> 
> I only tried:
> 
> 	PR target/28672
> 	* var-tracking.c (dump_dataflow_set): Start dumping at
> 	register zero.
> 	(clobber_variable_part): Kill only the variable part in
> 	registers holding it, leaving other variables alone.
> 
> 

I am enclosing it here.


H.J.
---
for  gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	PR target/28672
	* var-tracking.c (dump_dataflow_set): Start dumping at
	register zero.
	(clobber_variable_part): Kill only the variable part in
	registers holding it, leaving other variables alone.

Index: gcc/var-tracking.c
===================================================================
--- gcc/var-tracking.c.orig	2006-08-15 07:06:38.000000000 -0300
+++ gcc/var-tracking.c	2006-08-15 07:21:01.000000000 -0300
@@ -1960,7 +1960,7 @@ dump_dataflow_set (dataflow_set *set)
 
   fprintf (dump_file, "Stack adjustment: " HOST_WIDE_INT_PRINT_DEC "\n",
 	   set->stack_adjust);
-  for (i = 1; i < FIRST_PSEUDO_REGISTER; i++)
+  for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
     {
       if (set->regs[i])
 	{
@@ -2212,8 +2212,32 @@ clobber_variable_part (dataflow_set *set
 	  for (node = next; node; node = next)
 	    {
 	      next = node->next;
-	      if (REG_P (node->loc) && node->loc != loc)
-		var_reg_delete (set, node->loc, false);
+	      if (node->loc != loc)
+		{
+		  if (REG_P (node->loc))
+		    {
+		      attrs anode, anext;
+		      attrs *anextp;
+
+		      /* Remove the variable part from the register's
+			 list, but preserve any other variable parts
+			 that might be regarded as live in that same
+			 register.  */
+		      anextp = &set->regs[REGNO (node->loc)];
+		      for (anode = *anextp; anode; anode = anext)
+			{
+			  anext = anode->next;
+			  if (anode->decl == decl
+			      && anode->offset == offset)
+			    {
+			      pool_free (attrs_pool, anode);
+			      *anextp = anext;
+			    }
+			}
+		    }
+
+		  delete_variable_part (set, node->loc, decl, offset);
+		}
 	    }
 	}
     }


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