On 01/24/14 03:52, Jakub Jelinek wrote:
On Thu, Jan 23, 2014 at 02:22:35PM -0700, Jeff Law wrote:
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -5891,8 +5891,13 @@ find_assert_locations_1 (basic_block bb, sbitmap live)
                    }
                }

-             register_new_assert_for (op, op, comp_code, value, bb, NULL, si);
-             need_assert = true;
+             /* Do not register any assertions for a non-returning call.  */
+             if (!is_gimple_call (stmt) || !gimple_call_noreturn_p (stmt))
+               {
+                 register_new_assert_for (op, op, comp_code,
+                                          value, bb, NULL, si);
+                 need_assert = true;
+               }
            }
        }

I'd say this belongs into infer_value_range instead.
Seems reasonable.  I'll spin that.

The only downside is we lose the ability to backward propagate through a typecast which feeds an argument in such a call. But that's probably not a big deal.

Jeff

Reply via email to