aboutsummaryrefslogtreecommitdiff
path: root/gcc/expmed.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@redhat.com>2002-06-24 03:08:38 -0700
committerDavid S. Miller <davem@gcc.gnu.org>2002-06-24 03:08:38 -0700
commit556a56acec1f32fe977c0d48da84bbff4373fd93 (patch)
tree0b57b1ced0947668bcdbc374a39f118f0c2008e8 /gcc/expmed.c
parent2c35c7be14cfc9b9c515e5f4767c2f56e9217c44 (diff)
downloadgcc-556a56acec1f32fe977c0d48da84bbff4373fd93.zip
gcc-556a56acec1f32fe977c0d48da84bbff4373fd93.tar.gz
gcc-556a56acec1f32fe977c0d48da84bbff4373fd93.tar.bz2
sparc.c (INIT_TARGET_OPTABS): If ARCH64, set the 32-bit ABI libfuncs to NULL.
2002-06-24 David S. Miller <davem@redhat.com> * config/sparc/sparc.c (INIT_TARGET_OPTABS): If ARCH64, set the 32-bit ABI libfuncs to NULL. * expmed.c (expand_divmod): Do not set optab1/optab2 to the shift optabs if op1 is const0_rtx. From-SVN: r54950
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r--gcc/expmed.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 8ef4fca..317dcc4 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -3049,9 +3049,12 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp)
not straightforward to generalize this. Maybe we should make an array
of possible modes in init_expmed? Save this for GCC 2.7. */
- optab1 = (op1_is_pow2 ? (unsignedp ? lshr_optab : ashr_optab)
+ optab1 = ((op1_is_pow2 && op1 != const0_rtx)
+ ? (unsignedp ? lshr_optab : ashr_optab)
: (unsignedp ? udiv_optab : sdiv_optab));
- optab2 = (op1_is_pow2 ? optab1 : (unsignedp ? udivmod_optab : sdivmod_optab));
+ optab2 = ((op1_is_pow2 && op1 != const0_rtx)
+ ? optab1
+ : (unsignedp ? udivmod_optab : sdivmod_optab));
for (compute_mode = mode; compute_mode != VOIDmode;
compute_mode = GET_MODE_WIDER_MODE (compute_mode))