From: Segher Boessenkool Date: Mon, 11 Dec 2017 21:23:08 +0000 (+0100) Subject: ifcvt: Call fixup_partitions (PR83361) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9221f990e762755626257b019839fb83baee791f;p=gcc.git ifcvt: Call fixup_partitions (PR83361) After converting a conditional branch to an unconditional trap to a conditional trap, if the original trap is still reachable from another path, it may be that it is in a hot basic block and only reachable from cold blocks. Fix that up. PR rtl-optimization/83361 * ifcvt.c (if_convert): Call fixup_partitions. gcc/testsuite/ PR rtl-optimization/83361 * gcc.dg/pr83361.c: New testcase. From-SVN: r255550 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b1a689feeff..8c9fe1bfcc2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-12-11 Segher Boessenkool + + PR rtl-optimization/83361 + * ifcvt.c (if_convert): Call fixup_partitions. + 2017-12-11 Will Schmidt * config/rs6000/rs6000.c (rs6000_gimple_fold_builtin): Add support for diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index 91360d80615..eb3da68d1e8 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -5446,6 +5446,10 @@ if_convert (bool after_combine) if (optimize == 1) df_remove_problem (df_live); + /* Some non-cold blocks may now be only reachable from cold blocks. + Fix that up. */ + fixup_partitions (); + checking_verify_flow_info (); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dced5e7b59c..3c2f0d2bd83 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-12-11 Segher Boessenkool + + PR rtl-optimization/83361 + * gcc.dg/pr83361.c: New testcase. + 2017-12-11 Will Schmidt * gcc.target/powerpc/fold-vec-splat-misc-invalid.c: New. diff --git a/gcc/testsuite/gcc.dg/pr83361.c b/gcc/testsuite/gcc.dg/pr83361.c new file mode 100644 index 00000000000..2a6f80750e9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr83361.c @@ -0,0 +1,40 @@ +/* PR rtl-optimization/83361 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -freorder-blocks-and-partition" } */ + +#include + +int yz; + +void +tq (int z3) +{ + unsigned long long int n8 = (unsigned long long int)INT_MAX + 1; + int *ey = &yz; + + if (yz == 0) + { + int bc; + + yz = 1; + while (yz != 0) + { + *ey *= bc; + n8 = !!(1 / ((unsigned long long int)yz == n8)); + ey = &z3; + } + + while (z3 != 0) + { + } + } + + z3 = (n8 != 0) && (*ey != 0); + z3 = yz / z3; + if (z3 < 0) + { + if (yz != 0) + yz = 0; + yz /= 0; + } +}