From 0a237a94c206b53eb73baad2d75fbcca518df65e Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 11 Sep 2019 10:41:27 +0000 Subject: [PATCH] re PR rtl-optimization/89795 (wrong code with -O2 -fno-dce -fno-forward-propagate -fno-sched-pressure) PR rtl-optimization/89795 * rtlanal.c (nonzero_bits1) : Do not propagate results from inner REGs to paradoxical SUBREGs if WORD_REGISTER_OPERATIONS is set. From-SVN: r275635 --- gcc/ChangeLog | 6 ++++++ gcc/rtlanal.c | 2 +- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.target/sparc/20161111-1.c | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 33b43862051..3452012a45c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-09-11 Eric Botcazou + + PR rtl-optimization/89795 + * rtlanal.c (nonzero_bits1) : Do not propagate results from + inner REGs to paradoxical SUBREGs if WORD_REGISTER_OPERATIONS is set. + 2019-09-11 Jakub Jelinek PR tree-optimization/91723 diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 1fbbeda88b2..3a72db7572d 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -4819,7 +4819,7 @@ nonzero_bits1 (const_rtx x, scalar_int_mode mode, const_rtx known_x, || ((extend_op = load_extend_op (inner_mode)) == SIGN_EXTEND ? val_signbit_known_set_p (inner_mode, nonzero) : extend_op != ZERO_EXTEND) - || (!MEM_P (SUBREG_REG (x)) && !REG_P (SUBREG_REG (x)))) + || !MEM_P (SUBREG_REG (x))) && xmode_width > inner_width) nonzero |= (GET_MODE_MASK (GET_MODE (x)) & ~GET_MODE_MASK (inner_mode)); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d4488b6789c..cd9821e09ff 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-09-11 Eric Botcazou + + * gcc.target/sparc/20161111-1.c: XFAIL redundant zero-extension test. + 2019-09-11 Jakub Jelinek PR tree-optimization/91723 diff --git a/gcc/testsuite/gcc.target/sparc/20161111-1.c b/gcc/testsuite/gcc.target/sparc/20161111-1.c index eda8b0a9f12..8195fec8990 100644 --- a/gcc/testsuite/gcc.target/sparc/20161111-1.c +++ b/gcc/testsuite/gcc.target/sparc/20161111-1.c @@ -14,4 +14,4 @@ unsigned char ee_isdigit2(unsigned int i) return retval; } -/* { dg-final { scan-assembler-not "and\t%" } } */ +/* { dg-final { scan-assembler-not "and\t%" { xfail *-*-* } } } */ -- 2.30.2