diff options
author | Jim Wilson <wilson@cygnus.com> | 1998-10-21 19:27:19 +0000 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1998-10-21 12:27:19 -0700 |
commit | 7be7a07d27b88ef733255714b0ae5187cf18a428 (patch) | |
tree | e74cf64bef6571029f944536af0afa7cd3a4dc62 | |
parent | 822a4ff1627c2688dab2df69cf66245407bd7cd9 (diff) | |
download | gcc-7be7a07d27b88ef733255714b0ae5187cf18a428.zip gcc-7be7a07d27b88ef733255714b0ae5187cf18a428.tar.gz gcc-7be7a07d27b88ef733255714b0ae5187cf18a428.tar.bz2 |
Fix sparc builtin_memcpy miscompilation.
* expmed.c (store_bit_field): If need to add a SUBREG, then remove
existing SUBREG if we can, otherwise abort.
From-SVN: r23215
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/expmed.c | 13 |
2 files changed, 17 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9799e65..8f71571 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Wed Oct 21 19:23:59 1998 Jim Wilson <wilson@cygnus.com> + + * expmed.c (store_bit_field): If need to add a SUBREG, then remove + existing SUBREG if we can, otherwise abort. + Wed Oct 21 09:58:51 1998 Mark Mitchell <mark@markmitchell.com> * c-common.c (c_apply_type_quals_to_decl): Don't crash when diff --git a/gcc/expmed.c b/gcc/expmed.c index 1c9fcf5..2836c4c 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -423,7 +423,18 @@ store_bit_field (str_rtx, bitsize, bitnum, fieldmode, value, align, total_size) || GET_MODE_SIZE (GET_MODE (op0)) > UNITS_PER_WORD) { if (GET_CODE (op0) != REG) - op0 = copy_to_reg (op0); + { + /* Since this is a destination (lvalue), we can't copy it to a + pseudo. We can trivially remove a SUBREG that does not + change the size of the operand. Such a SUBREG may have been + added above. Otherwise, abort. */ + if (GET_CODE (op0) == SUBREG + && (GET_MODE_SIZE (GET_MODE (op0)) + == GET_MODE_SIZE (GET_MODE (SUBREG_REG (op0))))) + op0 = SUBREG_REG (op0); + else + abort (); + } op0 = gen_rtx_SUBREG (mode_for_size (BITS_PER_WORD, MODE_INT, 0), op0, offset); } |