diff options
author | Bob Wilson <bob.wilson@acm.org> | 2002-03-18 18:20:19 +0000 |
---|---|---|
committer | Bob Wilson <bwilson@gcc.gnu.org> | 2002-03-18 18:20:19 +0000 |
commit | eb8e00ea233bb1c028719a1f1c1b7c574e13e0d8 (patch) | |
tree | 6825bcec69a3b7d52662c15f09c9f068a3e1cb38 | |
parent | 71c6877d3e244be103d20e6eb146634d821b7475 (diff) | |
download | gcc-eb8e00ea233bb1c028719a1f1c1b7c574e13e0d8.zip gcc-eb8e00ea233bb1c028719a1f1c1b7c574e13e0d8.tar.gz gcc-eb8e00ea233bb1c028719a1f1c1b7c574e13e0d8.tar.bz2 |
xtensa.h (GO_IF_MODE_DEPENDENT_ADDRESS): Treat constant-pool addresses as "mode-dependent".
* config/xtensa/xtensa.h (GO_IF_MODE_DEPENDENT_ADDRESS): Treat
constant-pool addresses as "mode-dependent".
(GO_IF_LEGITIMATE_ADDRESS): Rename macro arguments.
From-SVN: r50984
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/xtensa/xtensa.h | 24 |
2 files changed, 24 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e7ff6b2..615d43e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2002-03-18 Bob Wilson <bob.wilson@acm.org> + + * config/xtensa/xtensa.h (GO_IF_MODE_DEPENDENT_ADDRESS): Treat + constant-pool addresses as "mode-dependent". + (GO_IF_LEGITIMATE_ADDRESS): Rename macro arguments. + 2002-03-18 Jakub Jelinek <jakub@redhat.com> PR target/5740 diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h index 9606bb3..4cd8616 100644 --- a/gcc/config/xtensa/xtensa.h +++ b/gcc/config/xtensa/xtensa.h @@ -1145,21 +1145,21 @@ typedef struct xtensa_args { #define MAX_REGS_PER_ADDRESS 1 /* Identify valid Xtensa addresses. */ -#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ +#define GO_IF_LEGITIMATE_ADDRESS(MODE, ADDR, LABEL) \ do { \ - rtx xinsn = (X); \ + rtx xinsn = (ADDR); \ \ /* allow constant pool addresses */ \ if ((MODE) != BLKmode && GET_MODE_SIZE (MODE) >= UNITS_PER_WORD \ && constantpool_address_p (xinsn)) \ - goto ADDR; \ + goto LABEL; \ \ while (GET_CODE (xinsn) == SUBREG) \ xinsn = SUBREG_REG (xinsn); \ \ /* allow base registers */ \ if (GET_CODE (xinsn) == REG && REG_OK_FOR_BASE_P (xinsn)) \ - goto ADDR; \ + goto LABEL; \ \ /* check for "register + offset" addressing */ \ if (GET_CODE (xinsn) == PLUS) \ @@ -1190,7 +1190,7 @@ typedef struct xtensa_args { && code1 == CONST_INT \ && xtensa_mem_offset (INTVAL (xplus1), (MODE))) \ { \ - goto ADDR; \ + goto LABEL; \ } \ } \ } while (0) @@ -1249,7 +1249,19 @@ typedef struct xtensa_args { } while (0) -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) {} +/* Treat constant-pool references as "mode dependent" since they can + only be accessed with SImode loads. This works around a bug in the + combiner where a constant pool reference is temporarily converted + to an HImode load, which is then assumed to zero-extend based on + our definition of LOAD_EXTEND_OP. This is wrong because the high + bits of a 16-bit value in the constant pool are now sign-extended + by default. */ + +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \ + do { \ + if (constantpool_address_p (ADDR)) \ + goto LABEL; \ + } while (0) /* If we are referencing a function that is static, make the SYMBOL_REF special so that we can generate direct calls to it even with -fpic. */ |