This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PR middle-end/20491] combine generates bad subregs
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Richard Henderson <rth at gcc dot gnu dot org>
- Cc: gcc-patches at gcc dot gnu dot org, gcc-bugzilla at gcc dot gnu dot org
- Date: 02 Apr 2005 13:57:13 -0300
- Subject: Re: [PR middle-end/20491] combine generates bad subregs
- Organization: Red Hat Global Engineering Services Compiler Team
- References: <oreke5bdlf.fsf@livre.redhat.lsd.ic.unicamp.br><or64zhb9uv.fsf@livre.redhat.lsd.ic.unicamp.br><20050328221118.GC23445@redhat.com><or1x9yyvs4.fsf@livre.redhat.lsd.ic.unicamp.br><orvf79ue6h.fsf@livre.redhat.lsd.ic.unicamp.br><20050331220923.GC8196@redhat.com>
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}