asan.c (create_cond_insert_point): Avoid use of REG_BR_PROB_BASE fixpoint arithmetics.
authorJan Hubicka <hubicka@ucw.cz>
Sun, 16 Jul 2017 16:28:57 +0000 (18:28 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sun, 16 Jul 2017 16:28:57 +0000 (16:28 +0000)
* asan.c (create_cond_insert_point): Avoid use of REG_BR_PROB_BASE
fixpoint arithmetics.

From-SVN: r250240

gcc/ChangeLog
gcc/asan.c

index f3bafa52d37fac22578c91f4265c2dbdab86d7e1..f17ed1fe91d51cb7128747174eac500792970cc2 100644 (file)
@@ -1,3 +1,8 @@
+2017-07-16  Jan Hubicka  <hubicka@ucw.cz>
+
+       * asan.c (create_cond_insert_point): Avoid use of REG_BR_PROB_BASE
+       fixpoint arithmetics.
+
 2017-07-16  Jan Hubicka  <hubicka@ucw.cz>
 
        * profile-count.h (profile_probability::from_reg_br_prob_note,
index a56174a165641b3054fcd86cfc2dc5e3a3b81846..5f9275f6425a1c29b11b2873edd599716c61f7dc 100644 (file)
@@ -1798,12 +1798,11 @@ create_cond_insert_point (gimple_stmt_iterator *iter,
 
   /* Set up the newly created 'then block'.  */
   e = make_edge (cond_bb, then_bb, EDGE_TRUE_VALUE);
-  int fallthrough_probability
+  profile_probability fallthrough_probability
     = then_more_likely_p
-    ? PROB_VERY_UNLIKELY
-    : PROB_ALWAYS - PROB_VERY_UNLIKELY;
-  e->probability = profile_probability::from_reg_br_prob_base
-               (PROB_ALWAYS - fallthrough_probability);
+    ? profile_probability::very_unlikely ()
+    : profile_probability::very_likely ();
+  e->probability = fallthrough_probability.invert ();
   if (create_then_fallthru_edge)
     make_single_succ_edge (then_bb, fallthru_bb, EDGE_FALLTHRU);
 
@@ -1811,8 +1810,7 @@ create_cond_insert_point (gimple_stmt_iterator *iter,
   e = find_edge (cond_bb, fallthru_bb);
   e->flags = EDGE_FALSE_VALUE;
   e->count = cond_bb->count;
-  e->probability
-        = profile_probability::from_reg_br_prob_base (fallthrough_probability);
+  e->probability = fallthrough_probability;
 
   /* Update dominance info for the newly created then_bb; note that
      fallthru_bb's dominance info has already been updated by