From a69648ef59fd9cec0d1cca717008ac4110a6599e Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Wed, 13 Feb 2008 15:20:13 +0000 Subject: [PATCH] handle failing tarval computations gracefully [r17688] --- ir/ir/iropt.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index 0e8ec274a..53c4d9b32 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.c @@ -3331,13 +3331,15 @@ static ir_node *transform_node_Minus(ir_node *n) { 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; + } } } -- 2.20.1