+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
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;
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);
}
}
--- /dev/null
+/* { 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" } } */