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: patch: kill_value: handle subregs that won't simplify


> > !       rtx o = x;
> ^^^^^^^^^^^^^^^^
> > !       x = simplify_subreg (GET_MODE (x), SUBREG_REG (x),
> > !                          GET_MODE (SUBREG_REG (x)), SUBREG_BYTE (x));
> > !       if (x == NULL_RTX)
> > !       x = SUBREG_REG (orig_rtx);
> 
> either orig_rtx or o, but not both?

You beat me to it :-).  I sent the patch on my workstation, not the
one on the machine I tested.  I was just in the process of sending this
email.

	* regrename.c (kill_value): Handle subreg's that won't simplify.

Index: regrename.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/regrename.c,v
retrieving revision 1.92
diff -c -p -r1.92 regrename.c
*** regrename.c	22 Nov 2004 15:18:50 -0000	1.92
--- regrename.c	11 Jan 2005 17:57:20 -0000
*************** kill_value_regno (unsigned int regno, un
*** 1104,1117 ****
  static void
  kill_value (rtx x, struct value_data *vd)
  {
    /* SUBREGS are supposed to have been eliminated by now.  But some
       ports, e.g. i386 sse, use them to smuggle vector type information
       through to instruction selection.  Each such SUBREG should simplify,
!      so if we get a NULL  we've done something wrong elsewhere.  */
  
    if (GET_CODE (x) == SUBREG)
!     x = simplify_subreg (GET_MODE (x), SUBREG_REG (x),
! 			 GET_MODE (SUBREG_REG (x)), SUBREG_BYTE (x));
    if (REG_P (x))
      {
        unsigned int regno = REGNO (x);
--- 1104,1123 ----
  static void
  kill_value (rtx x, struct value_data *vd)
  {
+   rtx orig_rtx = x;
+ 
    /* SUBREGS are supposed to have been eliminated by now.  But some
       ports, e.g. i386 sse, use them to smuggle vector type information
       through to instruction selection.  Each such SUBREG should simplify,
!      so if we get a NULL, we look inside the original register.  */
  
    if (GET_CODE (x) == SUBREG)
!     {
!       x = simplify_subreg (GET_MODE (x), SUBREG_REG (x),
! 			   GET_MODE (SUBREG_REG (x)), SUBREG_BYTE (x));
!       if (x == NULL_RTX)
! 	x = SUBREG_REG (orig_rtx);
!     }
    if (REG_P (x))
      {
        unsigned int regno = REGNO (x);


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