summaryrefslogtreecommitdiffhomepage
path: root/ir/lower
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2016-06-07 08:06:35 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2016-06-07 08:06:35 +0200
commit9500e1cb9f438db793f651766ebe613440ecea80 (patch)
treeabafe12e0a2fc57a43635140f82a2b1a07593603 /ir/lower
parentd4e62cfa05163b80b782490cdf51fbf5772dd50a (diff)
When making a 'Sub', automatically infer its mode from its operands.
Diffstat (limited to 'ir/lower')
-rw-r--r--ir/lower/lower_switch.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ir/lower/lower_switch.c b/ir/lower/lower_switch.c
index 56c0634..c6e9d32 100644
--- a/ir/lower/lower_switch.c
+++ b/ir/lower/lower_switch.c
@@ -243,7 +243,7 @@ static bool normalize_switch(switch_info_t *info, ir_mode *selector_mode)
ir_graph *irg = get_irn_irg(switchn);
ir_node *min_const = new_r_Const(irg, min);
dbg_info *dbgi = get_irn_dbg_info(switchn);
- selector = new_rd_Sub(dbgi, block, selector, min_const, mode);
+ selector = new_rd_Sub(dbgi, block, selector, min_const);
info->switch_max = tarval_sub(info->switch_max, min);
info->switch_min = get_mode_null(mode);
@@ -286,8 +286,7 @@ static ir_node *create_case_cond(const ir_switch_table_entry *entry,
cmp = new_rd_Cmp(dbgi, block, selector, minconst, ir_relation_equal);
} else {
ir_tarval *adjusted_max = tarval_sub(entry->max, entry->min);
- ir_node *sub = new_rd_Sub(dbgi, block, selector, minconst,
- get_tarval_mode(adjusted_max));
+ ir_node *sub = new_rd_Sub(dbgi, block, selector, minconst);
ir_node *maxconst = new_r_Const(irg, adjusted_max);
cmp = new_rd_Cmp(dbgi, block, sub, maxconst, ir_relation_less_equal);
}