summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/expmed.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3051b0df736..0feb0a20f74 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2008-09-02 Jan Hubicka <jh@suse.cz>
+
+ * expmed.c (expand_divmod): Fix test of smod_pow2_cheap and sdiv_pow2_cheap
+
2008-09-02 H.J. Lu <hongjiu.lu@intel.com>
* expr.c (emit_group_store): Don't assert stack temp mode size.
diff --git a/gcc/expmed.c b/gcc/expmed.c
index d4306f41a81..0daf7fa31f0 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -4086,8 +4086,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
goto fail1;
}
else if (EXACT_POWER_OF_2_OR_ZERO_P (d)
- && (rem_flag ? smod_pow2_cheap[compute_mode]
- : sdiv_pow2_cheap[compute_mode])
+ && (rem_flag ? smod_pow2_cheap[speed][compute_mode]
+ : sdiv_pow2_cheap[speed][compute_mode])
/* We assume that cheap metric is true if the
optab has an expander for this mode. */
&& ((optab_handler ((rem_flag ? smod_optab
@@ -4107,7 +4107,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
return gen_lowpart (mode, remainder);
}
- if (sdiv_pow2_cheap[compute_mode]
+ if (sdiv_pow2_cheap[speed][compute_mode]
&& ((optab_handler (sdiv_optab, compute_mode)->insn_code
!= CODE_FOR_nothing)
|| (optab_handler (sdivmod_optab, compute_mode)->insn_code