This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH COMMITTED: First lower-subreg patch
"Richard Guenther" <richard.guenther@gmail.com> writes:
> On 01 Feb 2007 07:40:14 -0800, Ian Lance Taylor <iant@google.com> wrote:
> > Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com> writes:
> >
> > > Ian Lance Taylor wrote:
> > > > I am about to commit the first lower-subreg patch. Where possible,
> > > > gcc/ChangeLog:
> > > > 2007-01-31 Richard Henderson <rth@redhat.com>
> > > > Ian Lance Taylor <iant@google.com>
> > >
> > > Hi, Ian!
> > > Unfortunately your patch leads to bootstrap failure at
> > > x86_64-redhat-linux. Error log is listed below.
> >
> > Sorry about that. I only tested on 32-bit systems. Not that I see
> > why this case couldn't arise on a 32-bit system.
> >
> > I'm currently testing this patch. I don't have an x86_64 bootstrap
> > going at the moment--could you give it a try? Thanks.
>
> It get's me past the failure point, so I suggest to apply it ;)
Makes sense.
Committed without a full test, on the grounds that 1) it should fix a
bootstrap problem, and 2) it will only change cases which would have
previously ICEd.
Ian
2007-02-01 Ian Lance Taylor <iant@google.com>
* lower-subreg.c (simplify_gen_subreg_concatn): If we ask for the
high part of a paradoxical subreg, return a constant zero.
Index: lower-subreg.c
===================================================================
--- lower-subreg.c (revision 121461)
+++ lower-subreg.c (working copy)
@@ -372,6 +372,8 @@ static rtx
simplify_gen_subreg_concatn (enum machine_mode outermode, rtx op,
enum machine_mode innermode, unsigned int byte)
{
+ rtx ret;
+
/* We have to handle generating a SUBREG of a SUBREG of a CONCATN.
If OP is a SUBREG of a CONCATN, then it must be a simple mode
change with the same size and offset 0, or it must extract a
@@ -405,9 +407,24 @@ simplify_gen_subreg_concatn (enum machin
gcc_assert (op != NULL_RTX);
gcc_assert (innermode == GET_MODE (op));
}
+
if (GET_CODE (op) == CONCATN)
return simplify_subreg_concatn (outermode, op, byte);
- return simplify_gen_subreg (outermode, op, innermode, byte);
+
+ ret = simplify_gen_subreg (outermode, op, innermode, byte);
+
+ /* If we see an insn like (set (reg:DI) (subreg:DI (reg:SI) 0)) then
+ resolve_simple_move will ask for the high part of the paradoxical
+ subreg, which does not have a value. Just return a zero. */
+ if (ret == NULL_RTX
+ && GET_CODE (op) == SUBREG
+ && SUBREG_BYTE (op) == 0
+ && (GET_MODE_SIZE (innermode)
+ > GET_MODE_SIZE (GET_MODE (SUBREG_REG (op)))))
+ return CONST0_RTX (outermode);
+
+ gcc_assert (ret != NULL_RTX);
+ return ret;
}
/* Return whether we should resolve X into the registers into which it