Hi! I have an improvement that handles tree-ssa/pr81588.c optimization even on branch cost 1, but as it is effectively an extension to the range var_bound optimization, I'm not sure it should be backported.
Therefore, this patch treats this testcase similarly to other testcases that rely on branch cost of 2 (so that there is BIT_IOR_EXPR and not 2 separate jumps). Tested on x86_64-linux, ok for 7.2? 2017-08-02 Jakub Jelinek <ja...@redhat.com> PR tree-optimization/81655 PR tree-optimization/81588 * gcc.dg/tree-ssa/pr81588.c: Use -mbranch-cost=2 where possible, don't run the test on branch-cost=1 targets. --- gcc/testsuite/gcc.dg/tree-ssa/pr81588.c.jj 2017-08-01 10:28:50.000000000 +0200 +++ gcc/testsuite/gcc.dg/tree-ssa/pr81588.c 2017-08-02 11:02:30.966184545 +0200 @@ -1,7 +1,8 @@ /* PR tree-optimization/81588 */ -/* { dg-do compile } */ +/* { dg-do compile { target { ! "m68k*-*-* mmix*-*-* bfin*-*-* v850*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* nios2*-*-*" } } } */ /* { dg-options "-O2 -fdump-tree-reassoc1-details" } */ - +/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } } */ + extern long long int a, c; extern unsigned short b; Jakub