diff options
author | Richard Kenner <kenner@vlsi1.ultra.nyu.edu> | 2001-11-15 14:58:19 +0000 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 2001-11-15 09:58:19 -0500 |
commit | fea54805d1cfdd197167865a35b198ac95df0eca (patch) | |
tree | bdb6c2f2be6cff5083eb5660c269ed15c1cd3306 /gcc/final.c | |
parent | 768caa286d153f6366c98154db2ecb5557af8c4a (diff) | |
download | gcc-fea54805d1cfdd197167865a35b198ac95df0eca.zip gcc-fea54805d1cfdd197167865a35b198ac95df0eca.tar.gz gcc-fea54805d1cfdd197167865a35b198ac95df0eca.tar.bz2 |
final.c (alter_subreg): If simplify_subreg can't do anything, handle REG ourselves and abort for others.
* final.c (alter_subreg): If simplify_subreg can't do anything,
handle REG ourselves and abort for others.
From-SVN: r47058
Diffstat (limited to 'gcc/final.c')
-rw-r--r-- | gcc/final.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gcc/final.c b/gcc/final.c index 733503e..9302fea 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -3038,7 +3038,26 @@ alter_subreg (xp) if (GET_CODE (y) == MEM) *xp = adjust_address (y, GET_MODE (x), SUBREG_BYTE (x)); else - *xp = simplify_subreg (GET_MODE (x), y, GET_MODE (y), SUBREG_BYTE (x)); + { + rtx new = simplify_subreg (GET_MODE (x), y, GET_MODE (y), + SUBREG_BYTE (x)); + + if (new != 0) + *xp = new; + /* Simplify_subreg can't handle some REG cases, but we have to. */ + else if (GET_CODE (y) == REG) + { + REGNO (x) = subreg_hard_regno (x, 1); + PUT_CODE (x, REG); + ORIGINAL_REGNO (x) = ORIGINAL_REGNO (y); + /* This field has a different meaning for REGs and SUBREGs. Make + sure to clear it! */ + x->used = 0; + } + else + abort (); + } + return *xp; } |