From 14083b56a12675c3da21c26eeb8a8e021074b5c7 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Fri, 14 Nov 2008 15:38:07 +0000 Subject: [PATCH] fix problems when folding constants of different mode [r23662] --- ir/ir/iropt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index 012526e42..f1acccb31 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.c @@ -5244,7 +5244,10 @@ static ir_node *transform_node_shl_shr(ir_node *n) { return n; } - assert(get_tarval_mode(tv_shl) == get_tarval_mode(tv_shr)); + if (get_tarval_mode(tv_shl) != get_tarval_mode(tv_shr)) { + tv_shl = tarval_convert_to(tv_shl, get_tarval_mode(tv_shr)); + } + assert(tv_mask != tarval_bad); assert(get_tarval_mode(tv_mask) == mode); -- 2.20.1