cfghooks.c (verify_flow_info): Check that edge probabilities are set.
authorJan Hubicka <hubicka@ucw.cz>
Fri, 13 Oct 2017 13:37:49 +0000 (15:37 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 13 Oct 2017 13:37:49 +0000 (13:37 +0000)
* cfghooks.c (verify_flow_info): Check that edge probabilities are
set.

From-SVN: r253728

gcc/ChangeLog
gcc/cfghooks.c

index 78bd1f88c63785f293faf7d652eda16854d05c8d..fefac6e0c957aa5364355a3a2452c7615f4946eb 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-13  Jan Hubicka  <hubicka@ucw.cz>
+
+       * cfghooks.c (verify_flow_info): Check that edge probabilities are
+       set.
+
 2017-10-13  Nathan Sidwell  <nathan@acm.org>
 
        * tree-core.h (tree_contains_struct): Make bool.
index 18dc49a035e604b153a36b093d582513d7d19564..c15c58c728e3878eeef5cdb42066acd83539d6a4 100644 (file)
@@ -152,6 +152,7 @@ verify_flow_info (void)
                 bb->index, bb->frequency);
          err = 1;
        }
+
       FOR_EACH_EDGE (e, ei, bb->succs)
        {
          if (last_visited [e->dest->index] == bb)
@@ -160,6 +161,13 @@ verify_flow_info (void)
                     e->src->index, e->dest->index);
              err = 1;
            }
+         if (profile_status_for_fn (cfun) >= PROFILE_GUESSED
+             && !e->probability.initialized_p ())
+           {
+             error ("Uninitialized probability of edge %i->%i", e->src->index,
+                    e->dest->index);
+             err = 1;
+           }
          if (!e->probability.verify ())
            {
              error ("verify_flow_info: Wrong probability of edge %i->%i",