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: [PR middle-end/20491] combine generates bad subregs


On Mar 31, 2005, Richard Henderson <rth@gcc.gnu.org> 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  <aoliva@redhat.com>

	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   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

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