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]

PATCH: RFA add case to purge addressof


In a note on an insn like this:

(set (reg:DI xx)
     (reg:DI yy))

we have a note:

(REG_RETVAL (REG_EQUAL (float_extend:DF (mem:sf (addressof:SI (reg:DI
zz)))

seems that we can get rid of this just using a simple subreg for the
note? Or, since it seems that this does the same as the condition above
I can just add it in there...

I stuck the abort in because we're should be aborting because, as it
says in the comment above, we _must_ do a replacement here.

OK? Thoughts?

-eric

-- 
Eric Christopher <echristo@redhat.com>

2003-10-25  Eric Christopher  <echristo@redhat.com>

	* function.c (purge_addressof_1): Add case for REG_RETVAL
	notes when modes are unequal.

Index: function.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/function.c,v
retrieving revision 1.294.2.1
diff -u -p -w -r1.294.2.1 function.c
--- function.c	15 Sep 2003 23:14:18 -0000	1.294.2.1
+++ function.c	27 Oct 2003 23:00:02 -0000
@@ -3086,7 +3086,16 @@ purge_addressof_1 (rtx *loc, rtx insn, i
 		      *loc = gen_rtx_SUBREG (GET_MODE (x), sub, 0);
 		      return true;
 		    }
+		  else if (GET_MODE_SIZE (GET_MODE (x))
+			   < GET_MODE_SIZE (GET_MODE (sub)))
+		    {
+		      /* Should be able to be handled via a simple
+			 subreg.  */
+		      *loc = gen_rtx_SUBREG (GET_MODE (x), sub, 0);
+		      return true;
+		    }
 		  /* ??? Are there other cases we should handle?  */
+		  abort ();
 		}
 	      /* Sometimes we may not be able to find the replacement.  For
 		 example when the original insn was a MEM in a wider mode,



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