]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/dojump.c
This patch fixes an issue where expansion of an ORIF expression arbitrarily...
authorTeresa Johnson <tejohnson@google.com>
Wed, 2 Oct 2013 19:18:17 +0000 (19:18 +0000)
committerTeresa Johnson <tejohnson@gcc.gnu.org>
Wed, 2 Oct 2013 19:18:17 +0000 (19:18 +0000)
commit99206ca90b8e53db1461366ac4ee4116a2673056
tree948779eafcef5cd8b6843ba98bb5ae65bea1435b
parent56e82b14747c3d14a9e2ffec324aa338f0693020
This patch fixes an issue where expansion of an ORIF expression arbitrarily...

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.

From-SVN: r203126
gcc/ChangeLog
gcc/dojump.c