diff options
author | David S. Miller <davem@tanya.rutgers.edu> | 1997-09-23 07:25:25 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1997-09-23 01:25:25 -0600 |
commit | e13a25d5a3927ea07c9a0e047bf2d72a765b7c7f (patch) | |
tree | 82fc0cd6179b187b9c38df4ee7197638c2eb9aaf /gcc/expmed.c | |
parent | 4fd10464e796a92bab1f9f30f913ef3b94676be1 (diff) | |
download | gcc-e13a25d5a3927ea07c9a0e047bf2d72a765b7c7f.zip gcc-e13a25d5a3927ea07c9a0e047bf2d72a765b7c7f.tar.gz gcc-e13a25d5a3927ea07c9a0e047bf2d72a765b7c7f.tar.bz2 |
expmed.c (expand_divmod): If compute_mode is not the same as mode...
* expmed.c (expand_divmod): If compute_mode is not the same as
mode, handle the case where convert_modes() causes op1 to no
longer be a CONST_INT.
From-SVN: r15672
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r-- | gcc/expmed.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c index fa3cc49..b6f77c8 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -2831,6 +2831,14 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp) { op0 = convert_modes (compute_mode, mode, op0, unsignedp); op1 = convert_modes (compute_mode, mode, op1, unsignedp); + + /* convert_modes may have tossed op1 into a register, so we + absolutely must recompute the following. */ + op1_is_constant = GET_CODE (op1) == CONST_INT; + op1_is_pow2 = (op1_is_constant + && ((EXACT_POWER_OF_2_OR_ZERO_P (INTVAL (op1)) + || (! unsignedp + && EXACT_POWER_OF_2_OR_ZERO_P (-INTVAL (op1)))))); } /* If one of the operands is a volatile MEM, copy it into a register. */ |