summaryrefslogtreecommitdiffhomepage
path: root/ir/be/mips
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2017-01-14 08:03:50 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2017-01-14 08:06:26 +0100
commit75257d05aa8554441a637fb7ed2092fc7f7cfddb (patch)
treecb6723a122ad8ab09a794a01124bd7ec830c137a /ir/be/mips
parent2a8f18f1ff9ede074c5486876119e8b41ab48ad0 (diff)
mips: Handle unordered relations in non-float Cmp.
They can happen at -O0.
Diffstat (limited to 'ir/be/mips')
-rw-r--r--ir/be/mips/mips_transform.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ir/be/mips/mips_transform.c b/ir/be/mips/mips_transform.c
index ecc0e18..237c599 100644
--- a/ir/be/mips/mips_transform.c
+++ b/ir/be/mips/mips_transform.c
@@ -473,7 +473,7 @@ static ir_node *gen_Cmp(ir_node *const node)
ir_node *r = get_Cmp_right(node);
ir_mode *const mode = get_irn_mode(l);
if (be_mode_needs_gp_reg(mode) && get_mode_size_bits(mode) == MIPS_MACHINE_SIZE) {
- ir_relation const rel = get_Cmp_relation(node);
+ ir_relation const rel = get_Cmp_relation(node) & ir_relation_less_equal_greater;
switch (rel) {
case ir_relation_greater:
case ir_relation_less_equal: {
@@ -519,7 +519,7 @@ static ir_node *gen_Cond(ir_node *const node)
ir_node *const l = get_Cmp_left(sel);
ir_mode *const mode = get_irn_mode(l);
if (be_mode_needs_gp_reg(mode) && get_mode_size_bits(mode) == MIPS_MACHINE_SIZE) {
- ir_relation rel = get_Cmp_relation(sel);
+ ir_relation rel = get_Cmp_relation(sel) & ir_relation_less_equal_greater;
ir_node *const r = get_Cmp_right(sel);
if (is_irn_null(r)) {
if (mode_is_signed(mode)) {
@@ -793,7 +793,7 @@ static ir_node *gen_Mux(ir_node *const node)
if (is_irn_null(get_Mux_false(node)) && is_irn_one(get_Mux_true(node))) {
ir_node *const sel = get_Mux_sel(node);
if (is_Cmp(sel)) {
- ir_relation const rel = get_Cmp_relation(sel);
+ ir_relation const rel = get_Cmp_relation(sel) & ir_relation_less_equal_greater;
if (rel == ir_relation_less || rel == ir_relation_greater)
return be_transform_node(sel);
}