aboutsummaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2008-08-28 20:02:54 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2008-08-28 20:02:54 +0000
commiteef302d277ea42968569a454ed89ba5c236fe156 (patch)
treef924db7c9c66de457eab2a6629f8d764877ab80c /gcc/simplify-rtx.c
parent9b3f31f2ed0f19d5c740684d85afd71152a473c0 (diff)
downloadgcc-eef302d277ea42968569a454ed89ba5c236fe156.zip
gcc-eef302d277ea42968569a454ed89ba5c236fe156.tar.gz
gcc-eef302d277ea42968569a454ed89ba5c236fe156.tar.bz2
rtl.h (simplify_subreg_regno): Declare.
gcc/ * rtl.h (simplify_subreg_regno): Declare. * rtlanal.c (simplify_subreg_regno): New function, split out from... * simplify-rtx.c (simplify_subreg): ...here. * reload.c (find_reloads): Use simplify_subreg_regno instead of subreg_offset_representable_p. From-SVN: r139736
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c34
1 files changed, 6 insertions, 28 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 6fd77ff..606a850 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -5069,35 +5069,13 @@ simplify_subreg (enum machine_mode outermode, rtx op,
suppress this simplification. If the hard register is the stack,
frame, or argument pointer, leave this as a SUBREG. */
- if (REG_P (op)
- && REGNO (op) < FIRST_PSEUDO_REGISTER
-#ifdef CANNOT_CHANGE_MODE_CLASS
- && ! (REG_CANNOT_CHANGE_MODE_P (REGNO (op), innermode, outermode)
- && GET_MODE_CLASS (innermode) != MODE_COMPLEX_INT
- && GET_MODE_CLASS (innermode) != MODE_COMPLEX_FLOAT)
-#endif
- && ((reload_completed && !frame_pointer_needed)
- || (REGNO (op) != FRAME_POINTER_REGNUM
-#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
- && REGNO (op) != HARD_FRAME_POINTER_REGNUM
-#endif
- ))
-#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
- && REGNO (op) != ARG_POINTER_REGNUM
-#endif
- && REGNO (op) != STACK_POINTER_REGNUM
- && subreg_offset_representable_p (REGNO (op), innermode,
- byte, outermode))
+ if (REG_P (op) && HARD_REGISTER_P (op))
{
- 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))
+ unsigned int regno, final_regno;
+
+ regno = REGNO (op);
+ final_regno = simplify_subreg_regno (regno, innermode, byte, outermode);
+ if (HARD_REGISTER_NUM_P (final_regno))
{
rtx x;
int final_offset = byte;