Message ID | c83cff0a-6a73-6a04-a713-fc20bf50f1d9@suse.cz |
---|---|
State | New |
Headers | show |
Series | Initialize split_branch_probability (PR target/82863). | expand |
> Hi. > > Following patch initializes global profile_probability. > > Ready for trunk after tests? > Thanks, > Martin > > gcc/ChangeLog: > > 2017-11-09 Martin Liska <mliska@suse.cz> > > PR target/82863 > * emit-rtl.c: Initialize split_branch_probability to > uninitialized. > > gcc/testsuite/ChangeLog: > > 2017-11-09 Martin Liska <mliska@suse.cz> > > * gcc.dg/pr82863.c: New test. Please move initialization to init_emit so we do not introduce new static constructor for no good reason. OK with this change. Honza
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; +}