Commit 453d4120 authored by Matthias Braun's avatar Matthias Braun
Browse files

fix firm producing invalid code for return a > 0 with a being an int

parent 9b19775f
......@@ -278,14 +278,14 @@ static ir_node *lower_node(ir_node *node)
}
case iro_Cmp: {
ir_node *left = get_Cmp_left(node);
ir_node *right = get_Cmp_right(node);
ir_mode *cmp_mode = get_irn_mode(left);
ir_node *left = get_Cmp_left(node);
ir_node *right = get_Cmp_right(node);
ir_mode *cmp_mode = get_irn_mode(left);
ir_relation relation = get_Cmp_relation(node);
if ((mode_is_int(cmp_mode) || mode_is_reference(cmp_mode)) &&
(get_mode_size_bits(cmp_mode) < get_mode_size_bits(mode) ||
(mode_is_signed(cmp_mode) && is_Const(right) && is_Const_null(right)))) {
ir_relation relation = get_Cmp_relation(node);
(mode_is_signed(cmp_mode) && is_Const(right) && is_Const_null(right) && relation != ir_relation_greater))) {
int need_not = 0;
ir_node *a = NULL;
ir_node *b = NULL;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment