Hi.
Following patch initializes global profile_probability.
Ready for trunk after tests?
Thanks,
Martin
gcc/ChangeLog:
2017-11-09 Martin Liska <[email protected]>
PR target/82863
* emit-rtl.c: Initialize split_branch_probability to
uninitialized.
gcc/testsuite/ChangeLog:
2017-11-09 Martin Liska <[email protected]>
* gcc.dg/pr82863.c: New test.
---
gcc/emit-rtl.c | 3 ++-
gcc/testsuite/gcc.dg/pr82863.c | 12 ++++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
create mode 100644 gcc/testsuite/gcc.dg/pr82863.c
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index cfe0fcec8e2..4ec3723ef9d 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -191,7 +191,8 @@ static rtx gen_const_vector (machine_mode, int);
static void copy_rtx_if_shared_1 (rtx *orig);
/* Probability of the conditional branch currently proceeded by try_split. */
-profile_probability split_branch_probability;
+profile_probability split_branch_probability
+ = profile_probability::uninitialized ();
/* Returns a hash code for X (which is a really a CONST_INT). */
diff --git a/gcc/testsuite/gcc.dg/pr82863.c b/gcc/testsuite/gcc.dg/pr82863.c
new file mode 100644
index 00000000000..b4028169a96
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr82863.c
@@ -0,0 +1,12 @@
+/* PR c/82167 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef long long a;
+a b;
+float
+c ()
+{
+ float d = b > 0;
+ return d;
+}