dojump.c (do_compare_rtx_and_jump): Sets correct probability for compiler inserted conditional jumps for NAN float...
* 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. From-SVN: r208860
This commit is contained in:
parent
e5d6141d82
commit
a0dbf28553
@ -1,3 +1,8 @@
|
||||
2014-03-26 Dehao Chen <dehao@google.com>
|
||||
|
||||
* dojump.c (do_compare_rtx_and_jump): Sets correct probability for
|
||||
compiler inserted conditional jumps for NAN float check.
|
||||
|
||||
2014-03-26 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* ubsan.h (ubsan_create_data): Change second argument's type
|
||||
|
11
gcc/dojump.c
11
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,7 @@
|
||||
2014-03-26 Dehao Chen <dehao@google.com>
|
||||
|
||||
* gcc.dg/predict-8.c: New test.
|
||||
|
||||
2014-03-26 Fabien Chêne <fabien@gcc.gnu.org>
|
||||
|
||||
PR c++/52369
|
||||
|
12
gcc/testsuite/gcc.dg/predict-8.c
Normal file
12
gcc/testsuite/gcc.dg/predict-8.c
Normal file
@ -0,0 +1,12 @@
|
||||
/* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
|
||||
/* { dg-options "-O2 -fdump-rtl-expand" } */
|
||||
|
||||
int foo(float a, float b) {
|
||||
if (a == b)
|
||||
return 1;
|
||||
else
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* { dg-final { scan-rtl-dump-times "REG_BR_PROB 100" 1 "expand"} } */
|
||||
/* { dg-final { cleanup-rtl-dump "expand" } } */
|
Loading…
Reference in New Issue
Block a user