aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-02-15 19:30:29 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1994-02-15 19:30:29 -0500
commit79777b798cb818ea1ac419e357263158f7b72acd (patch)
tree943628631dbc2612b1f19a8de92d98425ad58597 /gcc
parenta37adfc784385cabf2bbedcd0663919d8c32d2d7 (diff)
downloadgcc-79777b798cb818ea1ac419e357263158f7b72acd.zip
gcc-79777b798cb818ea1ac419e357263158f7b72acd.tar.gz
gcc-79777b798cb818ea1ac419e357263158f7b72acd.tar.bz2
(expand_increment): Handle both BAD_SUBREG and POST.
From-SVN: r6567
Diffstat (limited to 'gcc')
-rw-r--r--gcc/expr.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index c4356ae..ae1e5a4 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -7951,7 +7951,15 @@ expand_increment (exp, post)
SUBREG_REG (op0) = copy_to_reg (SUBREG_REG (op0));
else if (GET_CODE (op0) == SUBREG
&& GET_MODE_BITSIZE (GET_MODE (op0)) < BITS_PER_WORD)
- bad_subreg = 1;
+ {
+ /* We cannot increment this SUBREG in place. If we are
+ post-incrementing, get a copy of the old value. Otherwise,
+ just mark that we cannot increment in place. */
+ if (post)
+ op0 = copy_to_reg (op0);
+ else
+ bad_subreg = 1;
+ }
op0_is_copy = ((GET_CODE (op0) == SUBREG || GET_CODE (op0) == REG)
&& temp != get_last_insn ());