------- 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