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]

[new-ra] Reusing more refs


Hi,

Denis wondered about the code in ra-build.c, I wasn't sure if it's still
needed (it came from before df.c was reusing refs in modified insns),
added an abort(), hit it and fixed it.  The comment should clarify what
happened.  I leave the code there in case we hit the abort() also for
other reasons.  Bootstrapped on x86 (without Ada); still in libjava on
amd64.


Ciao,
Michael.
-- 
        * df.c (df_ref_search_cached): Don't check but set DF_REF_LOC.
        Fix formatting.
        * ra-build.c (parts_to_webs_1): Add abort for one (now impossible)
        case.

Index: df.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/df.c,v
retrieving revision 1.1.2.25
diff -u -p -r1.1.2.25 df.c
--- df.c	31 Oct 2003 23:01:46 -0000	1.1.2.25
+++ df.c	6 Nov 2003 16:55:39 -0000
@@ -739,15 +739,19 @@ df_ref_search_cached (struct df *df, rtx
   for (; link; link = link->next)
     {
       this_ref = link->ref;
+      /* We don't check 'loc' for equality.  Some of the methods to change
+	 insns actually reorder operands (like swapping them) which changes
+	 the location but not the interesting content.  We want to reuse
+	 also those refs.  */
       if (DF_REF_FLAGS (this_ref) & DF_REF_DELETED
           && DF_REF_REG (this_ref) == reg
-	  && DF_REF_LOC (this_ref) == loc
 	  && DF_REF_INSN (this_ref) == insn
 	  && DF_REF_TYPE (this_ref) == ref_type
-          && (DF_REF_FLAGS (this_ref)
-	      & (DF_REF_READ_WRITE | DF_REF_MODE_CHANGE
-		 | DF_REF_COMPARE_RELATED | DF_REF_STRIPPED)) == ref_flags)
+          && ref_flags == (DF_REF_FLAGS (this_ref)
+			    & (DF_REF_READ_WRITE | DF_REF_MODE_CHANGE
+			       | DF_REF_COMPARE_RELATED | DF_REF_STRIPPED)))
 	{
+	  DF_REF_LOC (this_ref) = loc;
 	  DF_REF_FLAGS (this_ref) &= ~DF_REF_DELETED;
 	  return this_ref;
 	}
Index: ra-build.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ra-build.c,v
retrieving revision 1.1.2.25
diff -u -p -r1.1.2.25 ra-build.c
--- ra-build.c	29 Oct 2003 13:59:24 -0000	1.1.2.25
+++ ra-build.c	6 Nov 2003 16:55:39 -0000
@@ -1995,6 +1995,7 @@ parts_to_webs_1 (struct df *df, struct w
 	{
 	  unsigned int count, r;
 	  struct ref **refs, **dfrefs;
+	  abort ();
 	  if (i < def_id)
 	    count = web->num_defs, refs = web->defs, dfrefs = df->defs;
 	  else


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