From b52ce03da5fcaf93480c6f0d95e9be500a97fb33 Mon Sep 17 00:00:00 2001 From: "J\"orn Rennecke" Date: Thu, 21 May 1998 11:35:10 +0000 Subject: [PATCH] combine.c (nonzero_bits): For paradoxical subregs, take LOAD_EXTENDED_OP into account. * combine.c (nonzero_bits): For paradoxical subregs, take LOAD_EXTENDED_OP into account. From-SVN: r19928 --- gcc/ChangeLog | 5 +++++ gcc/combine.c | 24 ++++++++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5bdc793f91c..077c913a85b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Thu May 21 19:32:27 1998 J"orn Rennecke + + * combine.c (nonzero_bits): For paradoxical subregs, take + LOAD_EXTENDED_OP into account. + Thu May 21 11:51:15 1998 Dave Brolley * configure.in (extra_c_objs): add prefix.o. diff --git a/gcc/combine.c b/gcc/combine.c index 68c084f047d..14da483ccd1 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -7693,15 +7693,23 @@ nonzero_bits (x, mode) { nonzero &= nonzero_bits (SUBREG_REG (x), mode); -#ifndef WORD_REGISTER_OPERATIONS - /* 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. */ - if (GET_MODE_SIZE (GET_MODE (x)) - > GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))) - nonzero |= (GET_MODE_MASK (GET_MODE (x)) - & ~ GET_MODE_MASK (GET_MODE (SUBREG_REG (x)))); +#if defined (WORD_REGISTER_OPERATIONS) && defined (LOAD_EXTEND_OP) + /* If this is a typical RISC machine, we only have to worry + about the way loads are extended. */ + if (LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) == SIGN_EXTEND + ? (nonzero + & (1L << (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (x))) - 1))) + : LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) != ZERO_EXTEND) #endif + { + /* 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. */ + if (GET_MODE_SIZE (GET_MODE (x)) + > GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))) + nonzero |= (GET_MODE_MASK (GET_MODE (x)) + & ~ GET_MODE_MASK (GET_MODE (SUBREG_REG (x)))); + } } break; -- 2.30.2