ir_node *mul_r = get_Mul_right(a);
if (is_Const(mul_r)) {
tarval *tv = tarval_neg(get_Const_tarval(mul_r));
- ir_node *cnst = new_Const(mode, tv);
- dbg_info *dbg = get_irn_dbg_info(a);
- ir_graph *irg = current_ir_graph;
- ir_node *block = get_nodes_block(a);
- n = new_rd_Mul(dbg, irg, block, mul_l, cnst, mode);
- DBG_OPT_ALGSIM2(oldn, a, n, FS_OPT_MINUS_MUL_C);
- return n;
+ if(tv != tarval_bad) {
+ ir_node *cnst = new_Const(mode, tv);
+ dbg_info *dbg = get_irn_dbg_info(a);
+ ir_graph *irg = current_ir_graph;
+ ir_node *block = get_nodes_block(a);
+ n = new_rd_Mul(dbg, irg, block, mul_l, cnst, mode);
+ DBG_OPT_ALGSIM2(oldn, a, n, FS_OPT_MINUS_MUL_C);
+ return n;
+ }
}
}