This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
patch: kill_value: handle subregs that won't simplify
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, rth at redhat dot com
- Date: Tue, 11 Jan 2005 13:42:52 -0400
- Subject: patch: kill_value: handle subregs that won't simplify
Hi Richard.
gcc.c-torture/compile/20000405-1.c fails to compile on e500v2 because we
get the following subreg which simplify_subreg won't simplify:
(subreg:DF (reg:DI 9 9) 0)
I discussed this with you before the holidays, but had yet to formally
submit a patch.
The following patch avoids the problem by continuing with the original
register, if we were unable to simplify the subreg.
OK for mainline?
Aldy
* regrename.c (kill_value): Handle subreg's that won't simplify.
Index: regrename.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/regrename.c,v
retrieving revision 1.92
diff -c -p -r1.92 regrename.c
*** regrename.c 22 Nov 2004 15:18:50 -0000 1.92
--- regrename.c 11 Jan 2005 17:41:08 -0000
*************** kill_value_regno (unsigned int regno, un
*** 1104,1117 ****
static void
kill_value (rtx x, struct value_data *vd)
{
/* SUBREGS are supposed to have been eliminated by now. But some
ports, e.g. i386 sse, use them to smuggle vector type information
through to instruction selection. Each such SUBREG should simplify,
! so if we get a NULL we've done something wrong elsewhere. */
if (GET_CODE (x) == SUBREG)
! x = simplify_subreg (GET_MODE (x), SUBREG_REG (x),
! GET_MODE (SUBREG_REG (x)), SUBREG_BYTE (x));
if (REG_P (x))
{
unsigned int regno = REGNO (x);
--- 1104,1124 ----
static void
kill_value (rtx x, struct value_data *vd)
{
+ rtx orig_rtx = x;
+
/* SUBREGS are supposed to have been eliminated by now. But some
ports, e.g. i386 sse, use them to smuggle vector type information
through to instruction selection. Each such SUBREG should simplify,
! so if we get a NULL, we look inside the original register. */
if (GET_CODE (x) == SUBREG)
! {
! rtx o = x;
! x = simplify_subreg (GET_MODE (x), SUBREG_REG (x),
! GET_MODE (SUBREG_REG (x)), SUBREG_BYTE (x));
! if (x == NULL_RTX)
! x = SUBREG_REG (orig_rtx);
! }
if (REG_P (x))
{
unsigned int regno = REGNO (x);