Commit c7423b93 authored by Jonas Fietz's avatar Jonas Fietz
Browse files

Fix a bug in comparison evaluation

VRP/jumpthreading: In the case of a calculated Lg-eval, the optimization sometimes assumed a false
result.

[r27568]
parent ea7d4bf4
......@@ -385,13 +385,16 @@ static int eval_cmp_tv(pn_Cmp pnc, tarval *tv_left, tarval *tv_right)
static int eval_cmp_vrp(pn_Cmp pnc, ir_node *left, ir_node *right)
{
pn_Cmp cmp_result = vrp_cmp(left, right);
/* does the compare evaluate to true? */
if (cmp_result == pn_Cmp_False)
if (cmp_result == pn_Cmp_False) {
return -1;
if ((cmp_result & pnc) != cmp_result)
}
if ((cmp_result & pnc) != cmp_result) {
if ((cmp_result & pnc) != 0) {
return -1;
}
return 0;
}
return 1;
}
/**
......
Markdown is supported
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