This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
subreg validation, part 1
- From: Richard Henderson <rth at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 23 Nov 2004 15:07:35 -0800
- Subject: subreg validation, part 1
The complete patch has received about as much testing as is likely.
I'm splitting the patch up into pieces so that it'll be easier to
figure out which is responsible for any particular failure on targets
that didn't report testing results after the first two cft's.
This bit fixes failures in the Sparc backend during splitting of
DFmode move operations into SFmode move operations. The intermediate
SUBREG that we created here is illegal. Fortunately, we don't need it.
r~
* simplify-rtx.c (simplify_subreg): Use subreg_regno_offset directly
instead of using a SUBREG temporary.
Index: simplify-rtx.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/simplify-rtx.c,v
retrieving revision 1.209
diff -c -p -d -r1.209 simplify-rtx.c
*** simplify-rtx.c 23 Nov 2004 16:20:44 -0000 1.209
--- simplify-rtx.c 23 Nov 2004 22:59:57 -0000
*************** simplify_subreg (enum machine_mode outer
*** 3675,3688 ****
&& subreg_offset_representable_p (REGNO (op), innermode,
byte, outermode))
{
! rtx tem = gen_rtx_SUBREG (outermode, op, byte);
! int final_regno = subreg_hard_regno (tem, 0);
/* ??? We do allow it if the current REG is not valid for
its mode. This is a kludge to work around how float/complex
arguments are passed on 32-bit SPARC and should be fixed. */
if (HARD_REGNO_MODE_OK (final_regno, outermode)
! || ! HARD_REGNO_MODE_OK (REGNO (op), innermode))
{
rtx x = gen_rtx_REG_offset (op, outermode, final_regno, byte);
--- 3675,3689 ----
&& subreg_offset_representable_p (REGNO (op), innermode,
byte, outermode))
{
! unsigned int regno = REGNO (op);
! unsigned int final_regno
! = regno + subreg_regno_offset (regno, innermode, byte, outermode);
/* ??? We do allow it if the current REG is not valid for
its mode. This is a kludge to work around how float/complex
arguments are passed on 32-bit SPARC and should be fixed. */
if (HARD_REGNO_MODE_OK (final_regno, outermode)
! || ! HARD_REGNO_MODE_OK (regno, innermode))
{
rtx x = gen_rtx_REG_offset (op, outermode, final_regno, byte);