diff options
author | dehao <dehao@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-03-27 00:41:10 +0000 |
---|---|---|
committer | dehao <dehao@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-03-27 00:41:10 +0000 |
commit | bb0803fb5e05aba7d357b9441386430b0cd42bf3 (patch) | |
tree | 057ed7df879caae5d8ea22deddf58784f2b9915d /gcc/dojump.c | |
parent | 92da758be022b3f6efa1bb7094a3299c5e1e6ac9 (diff) | |
download | gcc-bb0803fb5e05aba7d357b9441386430b0cd42bf3.tar.gz |
* dojump.c (do_compare_rtx_and_jump): Sets correct probability for
compiler inserted conditional jumps for NAN float check.
* gcc.dg/predict-8.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208860 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dojump.c')
-rw-r--r-- | gcc/dojump.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/dojump.c b/gcc/dojump.c index 7846314e030..1c3a2bee872 100644 --- a/gcc/dojump.c +++ b/gcc/dojump.c @@ -1103,6 +1103,11 @@ do_compare_rtx_and_jump (rtx op0, rtx op1, enum rtx_code code, int unsignedp, else { + int first_prob = prob; + if (first_code == UNORDERED) + first_prob = REG_BR_PROB_BASE / 100; + else if (first_code == ORDERED) + first_prob = REG_BR_PROB_BASE - REG_BR_PROB_BASE / 100; if (and_them) { rtx dest_label; @@ -1116,11 +1121,13 @@ do_compare_rtx_and_jump (rtx op0, rtx op1, enum rtx_code code, int unsignedp, else dest_label = if_false_label; do_compare_rtx_and_jump (op0, op1, first_code, unsignedp, mode, - size, dest_label, NULL_RTX, prob); + size, dest_label, NULL_RTX, + first_prob); } else do_compare_rtx_and_jump (op0, op1, first_code, unsignedp, mode, - size, NULL_RTX, if_true_label, prob); + size, NULL_RTX, if_true_label, + first_prob); } } |