summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2017-07-16 16:28:57 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2017-07-16 16:28:57 +0000
commit7dc9e270ede5fa6926c72b77283c7666b55d3a88 (patch)
tree69e818d236239a41c91720468efd0966c3674321
parent61cb18166c6a1507af78ce73a4e3c8a21b0cb8ab (diff)
downloadgcc-7dc9e270ede5fa6926c72b77283c7666b55d3a88.tar.gz
* asan.c (create_cond_insert_point): Avoid use of REG_BR_PROB_BASE
fixpoint arithmetics. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250240 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/asan.c12
2 files changed, 10 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f3bafa52d37..f17ed1fe91d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
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,
profile_probability::to_reg_br_prob_note): New functions.
* doc/rtl.texi (REG_BR_PROB_NOTE): Update documentation.
diff --git a/gcc/asan.c b/gcc/asan.c
index a56174a1656..5f9275f6425 100644
--- a/gcc/asan.c
+++ b/gcc/asan.c
@@ -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