This is the mail archive of the gcc@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: question regarding regrename and failure of 950704-1.c on main


On Fri, May 10, 2002 at 11:37:53AM -0400, John David Anglin wrote:
> The problem comes in the register rename pass.  The selection of di 22
> in the reload pass is ok since di 23 is dead.  Di 23 is copied initially
> to di 2.  However, the rename pass eliminates the copy and substitutes
> di 23 into the insn setting di 22.

So the problem as I understand it is that an argument register was
in a pair that was not HARD_REGNO_MODE_OK.  That definitely seems
questionable at best.

I suppose we can work around this wart by not recording registers
that aren't valid.  Give this a whirl.


r~


Index: regrename.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/regrename.c,v
retrieving revision 1.49
diff -c -p -d -r1.49 regrename.c
*** regrename.c	3 May 2002 12:07:29 -0000	1.49
--- regrename.c	10 May 2002 18:17:54 -0000
*************** copy_value (dest, src, vd)
*** 1239,1244 ****
--- 1239,1245 ----
  {
    unsigned int dr = REGNO (dest);
    unsigned int sr = REGNO (src);
+   enum machine_mode mode = GET_MODE (dest);
    unsigned int dn, sn;
    unsigned int i;
  
*************** copy_value (dest, src, vd)
*** 1257,1266 ****
      return;
  
    /* If SRC and DEST overlap, don't record anything.  */
!   dn = HARD_REGNO_NREGS (dr, GET_MODE (dest));
!   sn = HARD_REGNO_NREGS (sr, GET_MODE (dest));
    if ((dr > sr && dr < sr + sn)
        || (sr > dr && sr < dr + dn))
      return;
  
    /* If SRC had no assigned mode (i.e. we didn't know it was live)
--- 1258,1276 ----
      return;
  
    /* If SRC and DEST overlap, don't record anything.  */
!   dn = HARD_REGNO_NREGS (dr, mode);
!   sn = HARD_REGNO_NREGS (sr, mode);
    if ((dr > sr && dr < sr + sn)
        || (sr > dr && sr < dr + dn))
+     return;
+ 
+   /* ??? Some ports (hppa) have arguments in registers that are not
+      HARD_REGNO_MODE_OK.  We will have copied these invalid registers
+      into valid registers.  While this copy itself is technically 
+      invalid rtl, it has functioned properly until now.  Work around
+      this by not eliding the copy, by not recording a source register
+      that is invalid.  */
+   if (! HARD_REGNO_MODE_OK (sr, mode))
      return;
  
    /* If SRC had no assigned mode (i.e. we didn't know it was live)


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