This patch fixes an issue where expansion of an ORIF expression arbitrarily
commit262da27cf1917cc44d0927f0e3320985730c246c
authortejohnson <tejohnson@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 Oct 2013 19:18:17 +0000 (2 19:18 +0000)
committertejohnson <tejohnson@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 Oct 2013 19:18:17 +0000 (2 19:18 +0000)
tree948779eafcef5cd8b6843ba98bb5ae65bea1435b
parent396044e4348bc990d832dbaa6a5d63c1e3946e7e
This patch fixes an issue where expansion of an ORIF expression arbitrarily
applied the probability that the entire condition was true to just the
first condition. When the ORIF true probability was 100%, this resulted
in the second condition's jump being given a count of zero (since the
first condition's jump got 100% of the count), leading to incorrect function
splitting when it had a non-zero probability in reality. Since there
currently isn't better information about which condition resulted
in the ORIF being true, apply a 50-50 probability that it is the first
vs. second condition that caused the entire expression to be true,
so that neither condition's true label ends up as a 0-count bb.

An equivalent fix is made for ANDIF expansion.

2013-10-02  Teresa Johnson  <tejohnson@google.com>

* dojump.c (do_jump_1): Divide probability between
both conditions of a TRUTH_ORIF_EXPR.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203126 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/dojump.c