Commit 7a82f315 authored by Matthias Braun's avatar Matthias Braun
Browse files

fix arch_dep for mul(x,0)

parent d729c062
......@@ -572,13 +572,13 @@ ir_node *arch_dep_replace_mul_with_shifts(ir_node *irn)
ir_tarval *tv;
const ir_settings_arch_dep_t *params = be_get_backend_param()->dep_param;
/* If the architecture dependent optimizations were not initialized
or this optimization was not enabled. */
if (params == NULL || (opts & arch_dep_mul_to_shift) == 0)
return irn;
return res;
if (!is_Mul(irn) || !mode_is_int(mode))
assert(is_Mul(irn));
if (!mode_is_int(mode))
return res;
/* we should never do the reverse transformations again
......@@ -600,6 +600,11 @@ ir_node *arch_dep_replace_mul_with_shifts(ir_node *irn)
operand = left;
}
/* multiplications with 0 are a special case which we leave for
* equivalent_node_Mul because the code here can't handle them */
if (tv == get_mode_null(mode))
return res;
if (tv != NULL) {
res = do_decomposition(irn, operand, tv);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment