Force block enders to be simulated once.
authorRichard Henderson <rth@redhat.com>
Tue, 1 Sep 2009 14:37:52 +0000 (07:37 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 1 Sep 2009 14:37:52 +0000 (07:37 -0700)
From-SVN: r151273

gcc/ChangeLog
gcc/tree-ssa-ccp.c
gcc/tree-vrp.c

index 746ff6999d1a93ecee8d282ee2109eeee7d88388..2ea5c85097177dddf48523c9810ce21b4ca9c45e 100644 (file)
@@ -1,3 +1,10 @@
+2009-09-01  Richard Henderson  <rth@redhat.com>
+
+       * tree-ssa-ccp.c (ccp_initialize): Make sure to simulate 
+       stmt_ends_pp_p statements at least once.
+       * tree-vrp.c (vrp_initialize): Likewise.
+       (vrp_visit_stmt): Be prepared for non-interesting stmts.
+
 2009-09-01  Dodji Seketeli  <dodji@redhat.com>
 
        PR bootstrap/41205
index b359d4c8d767fb0bdc2c17f75a0b4259cd4e36de..949c4b5ce7766ec9fd4c4a27275bbe0b428424cb 100644 (file)
@@ -650,7 +650,15 @@ ccp_initialize (void)
       for (i = gsi_start_bb (bb); !gsi_end_p (i); gsi_next (&i))
         {
          gimple stmt = gsi_stmt (i);
-         bool is_varying = surely_varying_stmt_p (stmt);
+         bool is_varying;
+
+         /* If the statement is a control insn, then we do not
+            want to avoid simulating the statement once.  Failure
+            to do so means that those edges will never get added.  */
+         if (stmt_ends_bb_p (stmt))
+           is_varying = false;
+         else
+           is_varying = surely_varying_stmt_p (stmt);
 
          if (is_varying)
            {
index 5379b7555ac5e4f385885da52e1aabd73bb16b59..237245e761c96f5d900ff8ceda9e8982324b776b 100644 (file)
@@ -5317,7 +5317,12 @@ vrp_initialize (void)
         {
          gimple stmt = gsi_stmt (si);
 
-         if (!stmt_interesting_for_vrp (stmt))
+         /* If the statement is a control insn, then we do not
+            want to avoid simulating the statement once.  Failure
+            to do so means that those edges will never get added.  */
+         if (stmt_ends_bb_p (stmt))
+           prop_set_simulate_again (stmt, true);
+         else if (!stmt_interesting_for_vrp (stmt))
            {
              ssa_op_iter i;
              tree def;
@@ -5326,9 +5331,7 @@ vrp_initialize (void)
              prop_set_simulate_again (stmt, false);
            }
          else
-           {
-             prop_set_simulate_again (stmt, true);
-           }
+           prop_set_simulate_again (stmt, true);
        }
     }
 }
@@ -6087,7 +6090,9 @@ vrp_visit_stmt (gimple stmt, edge *taken_edge_p, tree *output_p)
       fprintf (dump_file, "\n");
     }
 
-  if (is_gimple_assign (stmt) || is_gimple_call (stmt))
+  if (!stmt_interesting_for_vrp (stmt))
+    gcc_assert (stmt_ends_bb_p (stmt));
+  else if (is_gimple_assign (stmt) || is_gimple_call (stmt))
     {
       /* In general, assignments with virtual operands are not useful
         for deriving ranges, with the obvious exception of calls to