[Bug tree-optimization/23603] VRP does not say range for a in a = b == c; is [0,1]
rguenth at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sun Jan 7 17:44:00 GMT 2007
------- Comment #10 from rguenth at gcc dot gnu dot org 2007-01-07 17:44 -------
In extract_range_from_binary we have another case where we drop to varying:
/* For integer ranges, apply the operation to each end of the
range and see what we end up with. */
if (code == TRUTH_ANDIF_EXPR
|| code == TRUTH_ORIF_EXPR
|| code == TRUTH_AND_EXPR
|| code == TRUTH_OR_EXPR)
{
...
else
{
set_value_range_to_varying (vr);
return;
}
}
But the latent problems seem to be fixed, the following (simple) patch
bootstrapped and regtested ok for me:
*************** extract_range_from_comparison (value_ran
*** 1920,1926 ****
set_value_range (vr, VR_RANGE, val, val, vr->equiv);
}
else
! set_value_range_to_varying (vr);
}
--- 1925,1933 ----
set_value_range (vr, VR_RANGE, val, val, vr->equiv);
}
else
! /* The result of a comparison is always true or false. */
! set_value_range (vr, VR_RANGE, build_int_cst (TREE_TYPE (expr), 0),
! build_int_cst (TREE_TYPE (expr), 1), vr->equiv);
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23603
More information about the Gcc-bugs
mailing list