From: Richard Henderson Date: Wed, 12 Dec 2001 03:00:01 +0000 (-0800) Subject: expmed.c (expand_divmod): Ignore sdiv_pow2_cheap for modes in which there is no divid... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a8c7e72da252fa6d01037d70d9bf24f9af37b07d;p=gcc.git expmed.c (expand_divmod): Ignore sdiv_pow2_cheap for modes in which there is no divide expander. * expmed.c (expand_divmod): Ignore sdiv_pow2_cheap for modes in which there is no divide expander. From-SVN: r47916 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 95d55b1e84d..47d63a612ac 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-12-11 Richard Henderson + + * expmed.c (expand_divmod): Ignore sdiv_pow2_cheap for modes in + which there is no divide expander. + 2001-12-11 Richard Henderson * except.c (sjlj_find_directly_reachable_regions): Don't diff --git a/gcc/expmed.c b/gcc/expmed.c index 8a7b6b91d55..8eecca34efa 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -3271,7 +3271,16 @@ expand_divmod (rem_flag, code, mode, op0, op1, target, unsignedp) goto fail1; } else if (EXACT_POWER_OF_2_OR_ZERO_P (d) - && (rem_flag ? smod_pow2_cheap : sdiv_pow2_cheap)) + && (rem_flag ? smod_pow2_cheap : sdiv_pow2_cheap) + /* ??? The cheap metric is computed only for + word_mode. If this operation is wider, this may + not be so. Assume true if the optab has an + expander for this mode. */ + && (((rem_flag ? smod_optab : sdiv_optab) + ->handlers[(int) compute_mode].insn_code + != CODE_FOR_nothing) + || (sdivmod_optab->handlers[(int) compute_mode] + .insn_code != CODE_FOR_nothing))) ; else if (EXACT_POWER_OF_2_OR_ZERO_P (abs_d)) {