diff options
author | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-09-04 01:53:01 +0000 |
---|---|---|
committer | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-09-04 01:53:01 +0000 |
commit | 186a20deb7b669c8b78f38b4d9b24ce4c45386ba (patch) | |
tree | 6141bc0566ce12f77e9b89892e9124b9e2a30347 /gcc/simplify-rtx.c | |
parent | 5d8d8bb1e64f962ed07daa269c5c85e500bb4a08 (diff) | |
download | gcc-186a20deb7b669c8b78f38b4d9b24ce4c45386ba.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71046 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r-- | gcc/simplify-rtx.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 919bea6aae2..6ace3480911 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 |