bool get_non_stale_global_range (irange &r, tree name);
void set_global_range (tree name, const irange &r);
+ void propagate_updated_value (tree name, basic_block bb);
+
non_null_ref m_non_null;
gori_compute m_gori;
void entry_range (irange &r, tree expr, basic_block bb);
void exit_range (irange &r, tree expr, basic_block bb);
- void propagate_updated_value (tree name, basic_block bb);
-
bitmap m_propfail;
vec<basic_block> m_workback;
vec<basic_block> m_update_list;
// If no name, simply call the base routine.
if (!name)
- res = fold_range_internal (r, s, NULL_TREE);
+ {
+ res = fold_range_internal (r, s, NULL_TREE);
+ if (res && is_a <gcond *> (s))
+ {
+ // Update any exports in the cache if this is a gimple cond statement.
+ tree exp;
+ basic_block bb = gimple_bb (s);
+ FOR_EACH_GORI_EXPORT_NAME (m_cache.m_gori, bb, exp)
+ m_cache.propagate_updated_value (exp, bb);
+ }
+ }
else if (!gimple_range_ssa_p (name))
res = get_tree_range (r, name, NULL);
// Check if the stmt has already been processed, and is not stale.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-evrp" } */
+void foo(void);
+
+static int a = 1;
+
+int main() {
+ int c = 0;
+ for (int b = 0; b <= 0; b++) {
+ if (!a)
+ foo();
+ if (b > c){
+ if (c)
+ continue;
+ a = 0;
+ }
+ c = 1;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate c_.* to 1" 1 "evrp" } } */