pr79095-5.C
632 Bytes
-
re PR tree-optimization/79095 (spurious stringop-overflow warning) · 6c022f73
PR tree-optimization/79095 * tree-vrp.c (extract_range_from_binary_expr_1): For EXACT_DIV_EXPR, if the numerator has the range ~[0,0] make the resultant range ~[0,0]. (extract_range_from_binary_expr): For MINUS_EXPR with no derived range, if the operands are known to be not equal, then the resulting range is ~[0,0]. (intersect_ranges): If the new range is ~[0,0] and the old range is wide, then prefer ~[0,0]. * tree-vrp.c (overflow_comparison_p_1): New function. (overflow_comparison_p): New function. * tree-vrp.c (register_edge_assert_for_2): Register additional asserts if NAME is used in an overflow test. (vrp_evaluate_conditional_warnv_with_ops): If the ops represent an overflow check that can be expressed as an equality test, then adjust ops to be that equality test. PR tree-optimization/79095 * g++.dg/pr79095-1.C: New test * g++.dg/pr79095-2.C: New test * g++.dg/pr79095-3.C: New test * g++.dg/pr79095-4.C: New test * g++.dg/pr79095-5.C: New test * gcc.c-torture/execute/arith-1.c: Update with more cases. * gcc.dg/tree-ssa/pr79095-1.c: New test. From-SVN: r245434
Jeff Law committed