aboutsummaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2003-09-04 01:53:01 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2003-09-04 01:53:01 +0000
commitbcfb807527a1ae01d056ce4a7e70ca0b4b86b35e (patch)
tree6141bc0566ce12f77e9b89892e9124b9e2a30347 /gcc/simplify-rtx.c
parent2a3ef884df38aba49d59970c91da8a8471dd2ff8 (diff)
downloadgcc-bcfb807527a1ae01d056ce4a7e70ca0b4b86b35e.zip
gcc-bcfb807527a1ae01d056ce4a7e70ca0b4b86b35e.tar.gz
gcc-bcfb807527a1ae01d056ce4a7e70ca0b4b86b35e.tar.bz2
re PR rtl-optimization/11700 ([M68K] ICE in subreg_hard_regno)
PR optimization/11700. * simplify-rtx.c (simplify_subreg): Check that the subreg offset of a hard register is representable before trying to simplify it using subreg_hard_regno. * gcc.c-torture/compile/20030903-1.c: New test case. From-SVN: r71046
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 919bea6..6ace348 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -3017,10 +3017,12 @@ simplify_subreg (enum machine_mode outermode, rtx op,
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
&& REGNO (op) != ARG_POINTER_REGNUM
#endif
- && REGNO (op) != STACK_POINTER_REGNUM)
+ && REGNO (op) != STACK_POINTER_REGNUM
+ && subreg_offset_representable_p (REGNO (op), innermode,
+ byte, outermode))
{
- int final_regno = subreg_hard_regno (gen_rtx_SUBREG (outermode, op, byte),
- 0);
+ 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