Commit 59530b35 authored by yb9976's avatar yb9976
Browse files

Prevent wrong optimization -0.0 + 0.0 -> -0.0 (should be +0.0).

This fixes opt/minus_zero.c.
parent cf92bd4e
......@@ -1043,15 +1043,15 @@ static ir_node *equivalent_node_Add(ir_node *n)
{
ir_node *oldn = n;
n = equivalent_node_neutral_zero(n);
if (n != oldn)
return n;
/* these optimizations are imprecise for floating point ops */
ir_mode *mode = get_irn_mode(n);
if (mode_is_float(mode) && !ir_imprecise_float_transforms_allowed())
return n;
n = equivalent_node_neutral_zero(n);
if (n != oldn)
return n;
ir_node *left = get_Add_left(n);
ir_node *right = get_Add_right(n);
......
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