diff options
author | Segher Boessenkool <segher@kernel.crashing.org> | 2017-12-11 22:23:08 +0100 |
---|---|---|
committer | Segher Boessenkool <segher@gcc.gnu.org> | 2017-12-11 22:23:08 +0100 |
commit | 9221f990e762755626257b019839fb83baee791f (patch) | |
tree | a59c34858bd817724bd7482e02dd84a1b2f584b5 /gcc | |
parent | a5648717a8826a1bb60afd31b56c48b60d3813d4 (diff) | |
download | gcc-9221f990e762755626257b019839fb83baee791f.zip gcc-9221f990e762755626257b019839fb83baee791f.tar.gz gcc-9221f990e762755626257b019839fb83baee791f.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ifcvt.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr83361.c | 40 |
4 files changed, 54 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b1a689fe..8c9fe1b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-12-11 Segher Boessenkool <segher@kernel.crashing.org> + + PR rtl-optimization/83361 + * ifcvt.c (if_convert): Call fixup_partitions. + 2017-12-11 Will Schmidt <will_schmidt@vnet.ibm.com> * config/rs6000/rs6000.c (rs6000_gimple_fold_builtin): Add support for diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index 91360d8..eb3da68 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 dced5e7..3c2f0d2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-12-11 Segher Boessenkool <segher@kernel.crashing.org> + + PR rtl-optimization/83361 + * gcc.dg/pr83361.c: New testcase. + 2017-12-11 Will Schmidt <will_schmidt@vnet.ibm.com> * 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 0000000..2a6f807 --- /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 <limits.h> + +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; + } +} |