------- Additional Comments From aoliva at gcc dot gnu dot org  2005-04-02 
16:57 -------
Subject: Re: [PR middle-end/20491] combine generates bad subregs

On Mar 31, 2005, Richard Henderson <[EMAIL PROTECTED]> wrote:

> On Wed, Mar 30, 2005 at 04:27:50PM -0300, Alexandre Oliva wrote:
>> -      else
>> +      else if (REG_P (y))
>> {
>> /* Simplify_subreg can't handle some REG cases, but we have to.  */
>> unsigned int regno = subreg_regno (x);

> The next line is 

>           gcc_assert (REG_P (y));

> you should remove that.  Ok with that change.

Thanks, here's what I'm checking in.

Index: gcc/ChangeLog
from  Alexandre Oliva  <[EMAIL PROTECTED]>

        PR middle-end/20491
        * final.c (alter_subreg): Don't call subreg_regno for a non-REG.

Index: gcc/final.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/final.c,v
retrieving revision 1.349
diff -u -p -r1.349 final.c
--- gcc/final.c 1 Apr 2005 15:27:58 -0000       1.349
+++ gcc/final.c 1 Apr 2005 20:19:02 -0000
@@ -2547,11 +2547,10 @@ alter_subreg (rtx *xp)
 
       if (new != 0)
        *xp = new;
-      else
+      else if (REG_P (y))
        {
          /* Simplify_subreg can't handle some REG cases, but we have to.  */
          unsigned int regno = subreg_regno (x);
-         gcc_assert (REG_P (y));
          *xp = gen_rtx_REG_offset (y, GET_MODE (x), regno, SUBREG_BYTE (x));
        }
     }

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   [EMAIL PROTECTED], gcc.gnu.org}
Free Software Evangelist  [EMAIL PROTECTED], gnu.org}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20491

Reply via email to