--- /dev/null
+/* PR tree-optimization/101496 */
+/* { dg-do compile } */
+/* { dg-options "-O2 " } */
+
+int c_1, li_2, us_3, func_14_s_5;
+
+void func_14() {
+ {
+ unsigned uli_8 = 0;
+ lbl1806324B:
+ if (uli_8 /= us_3 |= func_14_s_5 < 0 | func_14_s_5 != c_1) {
+ uli_8 += c_1 >= us_3;
+ if (uli_8)
+ ;
+ else
+ li_2 &&func_14_s_5 <= c_1 ?: 0;
+ unsigned *ptr_9 = &uli_8;
+ }
+ }
+ goto lbl1806324B;
+}
+
bool
simplify_using_ranges::fold_cond (gcond *cond)
{
- /* ?? vrp_folder::fold_predicate_in() is a superset of this. At
- some point we should merge all variants of this code. */
- edge taken_edge;
- vrp_visit_cond_stmt (cond, &taken_edge);
-
int_range_max r;
if (query->range_of_stmt (r, cond) && r.singleton_p ())
{
if (r.zero_p ())
{
- gcc_checking_assert (!taken_edge
- || taken_edge->flags & EDGE_FALSE_VALUE);
- if (dump_file && (dump_flags & TDF_DETAILS) && !taken_edge)
+ if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "\nPredicate evaluates to: 0\n");
gimple_cond_make_false (cond);
}
else
{
- gcc_checking_assert (!taken_edge
- || taken_edge->flags & EDGE_TRUE_VALUE);
- if (dump_file && (dump_flags & TDF_DETAILS) && !taken_edge)
+ if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "\nPredicate evaluates to: 1\n");
gimple_cond_make_true (cond);
}
return true;
}
+ /* ?? vrp_folder::fold_predicate_in() is a superset of this. At
+ some point we should merge all variants of this code. */
+ edge taken_edge;
+ vrp_visit_cond_stmt (cond, &taken_edge);
+
if (taken_edge)
{
if (taken_edge->flags & EDGE_TRUE_VALUE)
- gimple_cond_make_true (cond);
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "\nVRP Predicate evaluates to: 1\n");
+ gimple_cond_make_true (cond);
+ }
else if (taken_edge->flags & EDGE_FALSE_VALUE)
- gimple_cond_make_false (cond);
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "\nVRP Predicate evaluates to: 0\n");
+ gimple_cond_make_false (cond);
+ }
else
gcc_unreachable ();
update_stmt (cond);