From: segher Date: Tue, 18 Sep 2018 16:19:56 +0000 (+0000) Subject: Handle CLOBBER in reg_overlap_mentioned_p (PR86882) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4a60a19da8973e71d5e2b5035295585d7f50a27;p=thirdparty%2Fgcc.git Handle CLOBBER in reg_overlap_mentioned_p (PR86882) Combine will put CLOBBER (with a non-void mode) anywhere in a pattern to poison it. reg_overlap_mentioned_p did not handle this. This patch fixes that. PR rtl-optimization/86882 * rtlanal.c (reg_overlap_mentioned_p): Handle CLOBBER. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264400 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a0e9093ff323..6f4e131384ee 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-09-18 Segher Boessenkool + + PR rtl-optimization/86882 + * rtlanal.c (reg_overlap_mentioned_p): Handle CLOBBER. + 2018-09-18 Uros Bizjak * config/i386/i386.md (*extendxf2): Macroize insn from diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 6c620a4a3e50..366df7c9b3fa 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -1815,6 +1815,7 @@ reg_overlap_mentioned_p (const_rtx x, const_rtx in) recurse: switch (GET_CODE (x)) { + case CLOBBER: case STRICT_LOW_PART: case ZERO_EXTRACT: case SIGN_EXTRACT: @@ -4757,17 +4758,17 @@ nonzero_bits1 (const_rtx x, scalar_int_mode mode, const_rtx known_x, nonzero &= cached_nonzero_bits (SUBREG_REG (x), mode, known_x, known_mode, known_ret); - /* On many CISC machines, accessing an object in a wider mode + /* On many CISC machines, accessing an object in a wider mode causes the high-order bits to become undefined. So they are not known to be zero. */ rtx_code extend_op; if ((!WORD_REGISTER_OPERATIONS /* If this is a typical RISC machine, we only have to worry about the way loads are extended. */ + || !MEM_P (SUBREG_REG (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)))) + : extend_op != ZERO_EXTEND)) && xmode_width > inner_width) nonzero |= (GET_MODE_MASK (GET_MODE (x)) & ~GET_MODE_MASK (inner_mode));