diff options
author | Mark Shinwell <shinwell@codesourcery.com> | 2006-08-23 09:46:57 +0000 |
---|---|---|
committer | Mark Shinwell <shinwell@codesourcery.com> | 2006-08-23 09:46:57 +0000 |
commit | ac744790f0c5ebcca2335b36c6fafc7b687d0106 (patch) | |
tree | 403ebece79e7fd86384a674fcefded7c9f8d2687 | |
parent | 52f23ff898c582995faf4b6cd102d2e63458744f (diff) |
* recog.c (mode_dependent_address_p): Identify pre-increment,
pre-decrement, post-increment and post-decrement addressing as always
being mode-dependent.
* config/m32c/m32c.c (m32c_mode_dependent_address): Delete.
* config/m32c/m32c.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
* config/m32c/m32c-protos.h (m32c_mode_dependent_address): Delete.
* config/m32r/m32r.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete PRE_DEC,
PRE_INC and POST_INC checks.
* config/i386/i386.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
* config/sh/sh.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
* config/pdp11/pdp11.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
* config/avr/avr.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
* config/c4x/c4x.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete PRE_DEC,
PRE_INC, POST_DEC and POST_INC cases.
* config/stormy16/stormy16.c (xstormy16_mode_dependent_address_p):
Delete POST_INC and PRE_DEC cases.
* config/m68hc11/m68hc11.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to
no-op.
* config/cris/cris.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
* config/mn10300/mn10300.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to
no-op.
* config/ia64/ia64.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
* config/m68k/m68k.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
* config/rs6000/rs6000.c (rs6000_mode_dependent_address): Delete
PRE_INC and PRE_DEC cases.
* config/arc/arc.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
* config/mcore/mcore.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
* config/arm/arm.h (ARM_GO_IF_MODE_DEPENDENT_ADDRESS): Delete.
(GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
* config/pa/pa.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
* config/vax/vax.c (vax_mode_dependent_address_p): Delete
auto-increment cases.
* config/h8300/h8300.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete
auto-increment cases.
* config/bfin/bfin.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op.
gcc/testsuite/
* gcc.c-torture/execute/mode-dependent-address.c: New test.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/csl/sourcerygxx-4_1@116344 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | ChangeLog.csl | 42 | ||||
-rw-r--r-- | gcc/config/arc/arc.h | 7 | ||||
-rw-r--r-- | gcc/config/arm/arm.h | 13 | ||||
-rw-r--r-- | gcc/config/avr/avr.h | 4 | ||||
-rw-r--r-- | gcc/config/bfin/bfin.h | 8 | ||||
-rw-r--r-- | gcc/config/c4x/c4x.h | 7 | ||||
-rw-r--r-- | gcc/config/cris/cris.h | 11 | ||||
-rw-r--r-- | gcc/config/crx/crx.h | 6 | ||||
-rw-r--r-- | gcc/config/h8300/h8300.h | 5 | ||||
-rw-r--r-- | gcc/config/i386/i386.h | 10 | ||||
-rw-r--r-- | gcc/config/ia64/ia64.h | 4 | ||||
-rw-r--r-- | gcc/config/m32c/m32c-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/m32c/m32c.c | 9 | ||||
-rw-r--r-- | gcc/config/m32c/m32c.h | 4 | ||||
-rw-r--r-- | gcc/config/m32r/m32r.h | 5 | ||||
-rw-r--r-- | gcc/config/m68hc11/m68hc11.h | 7 | ||||
-rw-r--r-- | gcc/config/m68k/m68k.h | 6 | ||||
-rw-r--r-- | gcc/config/mcore/mcore.h | 7 | ||||
-rw-r--r-- | gcc/config/mn10300/mn10300.h | 4 | ||||
-rw-r--r-- | gcc/config/pa/pa.h | 7 | ||||
-rw-r--r-- | gcc/config/pdp11/pdp11.h | 8 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 4 | ||||
-rw-r--r-- | gcc/config/sh/sh.h | 10 | ||||
-rw-r--r-- | gcc/config/stormy16/stormy16.c | 4 | ||||
-rw-r--r-- | gcc/config/vax/vax.c | 4 | ||||
-rw-r--r-- | gcc/recog.c | 13 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/mode-dependent-address.c | 49 |
27 files changed, 135 insertions, 124 deletions
diff --git a/ChangeLog.csl b/ChangeLog.csl index deb0db0f43b..21162b4b1c0 100644 --- a/ChangeLog.csl +++ b/ChangeLog.csl @@ -1,3 +1,45 @@ +2006-08-23 Mark Shinwell <shinwell@codesourcery.com> + + gcc/ + * recog.c (mode_dependent_address_p): Identify pre-increment, + pre-decrement, post-increment and post-decrement addressing as always + being mode-dependent. + * config/m32c/m32c.c (m32c_mode_dependent_address): Delete. + * config/m32c/m32c.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op. + * config/m32c/m32c-protos.h (m32c_mode_dependent_address): Delete. + * config/m32r/m32r.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete PRE_DEC, + PRE_INC and POST_INC checks. + * config/i386/i386.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op. + * config/sh/sh.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op. + * config/pdp11/pdp11.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op. + * config/avr/avr.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op. + * config/c4x/c4x.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete PRE_DEC, + PRE_INC, POST_DEC and POST_INC cases. + * config/stormy16/stormy16.c (xstormy16_mode_dependent_address_p): + Delete POST_INC and PRE_DEC cases. + * config/m68hc11/m68hc11.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to + no-op. + * config/cris/cris.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op. + * config/mn10300/mn10300.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to + no-op. + * config/ia64/ia64.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op. + * config/m68k/m68k.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op. + * config/rs6000/rs6000.c (rs6000_mode_dependent_address): Delete + PRE_INC and PRE_DEC cases. + * config/arc/arc.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op. + * config/mcore/mcore.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op. + * config/arm/arm.h (ARM_GO_IF_MODE_DEPENDENT_ADDRESS): Delete. + (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op. + * config/pa/pa.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op. + * config/vax/vax.c (vax_mode_dependent_address_p): Delete + auto-increment cases. + * config/h8300/h8300.h (GO_IF_MODE_DEPENDENT_ADDRESS): Delete + auto-increment cases. + * config/bfin/bfin.h (GO_IF_MODE_DEPENDENT_ADDRESS): Change to no-op. + + gcc/testsuite/ + * gcc.c-torture/execute/mode-dependent-address.c: New test. + 2006-08-21 Mark Shinwell <shinwell@codesourcery.com> gcc/testsuite/ diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h index c7253b1146f..93922243b91 100644 --- a/gcc/config/arc/arc.h +++ b/gcc/config/arc/arc.h @@ -799,12 +799,7 @@ do { \ /* Go to LABEL if ADDR (a legitimate address expression) has an effect that depends on the machine mode it is used for. */ -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \ -{ if (GET_CODE (ADDR) == PRE_DEC) \ - goto LABEL; \ - if (GET_CODE (ADDR) == PRE_INC) \ - goto LABEL; \ -} +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) do {} while (0) /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE, return the mode to be used for the comparison. */ diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 1f962da9650..fe494dbeab4 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -2220,18 +2220,7 @@ do { \ /* Go to LABEL if ADDR (a legitimate address expression) has an effect that depends on the machine mode it is used for. */ -#define ARM_GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \ -{ \ - if ( GET_CODE (ADDR) == PRE_DEC || GET_CODE (ADDR) == POST_DEC \ - || GET_CODE (ADDR) == PRE_INC || GET_CODE (ADDR) == POST_INC) \ - goto LABEL; \ -} - -/* Nothing helpful to do for the Thumb */ -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \ - if (TARGET_32BIT) \ - ARM_GO_IF_MODE_DEPENDENT_ADDRESS (ADDR, LABEL) - +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) do {} while (0) /* Specify the machine mode that this machine uses for the index in the tablejump instruction. */ diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h index 53a0f9fb567..f4c97b182fd 100644 --- a/gcc/config/avr/avr.h +++ b/gcc/config/avr/avr.h @@ -435,9 +435,7 @@ do { \ } \ } while(0) -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ - if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == PRE_DEC) \ - goto LABEL +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) do {} while (0) #define LEGITIMATE_CONSTANT_P(X) 1 diff --git a/gcc/config/bfin/bfin.h b/gcc/config/bfin/bfin.h index 50f5292cc71..c53ba9f7106 100644 --- a/gcc/config/bfin/bfin.h +++ b/gcc/config/bfin/bfin.h @@ -727,13 +727,7 @@ do { \ You may assume that ADDR is a valid address for the machine. */ -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ -do { \ - if (GET_CODE (ADDR) == POST_INC \ - || GET_CODE (ADDR) == POST_DEC \ - || GET_CODE (ADDR) == PRE_DEC) \ - goto LABEL; \ -} while (0) +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) do {} while (0) #define NOTICE_UPDATE_CC(EXPR, INSN) 0 diff --git a/gcc/config/c4x/c4x.h b/gcc/config/c4x/c4x.h index 43d44b1ce8c..f3db100073b 100644 --- a/gcc/config/c4x/c4x.h +++ b/gcc/config/c4x/c4x.h @@ -1156,13 +1156,8 @@ CUMULATIVE_ARGS; } /* No mode-dependent addresses on the C4x are autoincrements. */ - #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \ - if (GET_CODE (ADDR) == PRE_DEC \ - || GET_CODE (ADDR) == POST_DEC \ - || GET_CODE (ADDR) == PRE_INC \ - || GET_CODE (ADDR) == POST_INC \ - || GET_CODE (ADDR) == POST_MODIFY \ + if (GET_CODE (ADDR) == POST_MODIFY \ || GET_CODE (ADDR) == PRE_MODIFY) \ goto LABEL diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h index 584fd214539..35d06e4cab6 100644 --- a/gcc/config/cris/cris.h +++ b/gcc/config/cris/cris.h @@ -1069,14 +1069,9 @@ struct cum_args {int regs;}; while (0) /* In CRIS, only the postincrement address mode depends thus, - since the increment depends on the size of the operand. */ -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \ - do \ - { \ - if (GET_CODE (ADDR) == POST_INC) \ - goto LABEL; \ - } \ - while (0) + since the increment depends on the size of the operand. This is now + treated generically within recog.c. */ +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) do {} while (0) #define LEGITIMATE_CONSTANT_P(X) 1 diff --git a/gcc/config/crx/crx.h b/gcc/config/crx/crx.h index 9277a28d891..b1ce87a98d7 100644 --- a/gcc/config/crx/crx.h +++ b/gcc/config/crx/crx.h @@ -405,11 +405,7 @@ struct cumulative_args } #endif /* REG_OK_STRICT */ -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \ -{ \ - if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == POST_DEC) \ - goto LABEL; \ -} +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) do {} while (0); #define LEGITIMATE_CONSTANT_P(X) 1 diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index cf64b09d2ae..7c9a2414bdf 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -939,11 +939,6 @@ struct cum_arg (the amount of decrement or increment being the length of the operand). */ #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \ - if (GET_CODE (ADDR) == POST_INC \ - || GET_CODE (ADDR) == POST_DEC \ - || GET_CODE (ADDR) == PRE_INC \ - || GET_CODE (ADDR) == PRE_DEC) \ - goto LABEL; \ if (GET_CODE (ADDR) == PLUS \ && h8300_get_index (XEXP (ADDR, 0), VOIDmode, 0) != XEXP (ADDR, 0)) \ goto LABEL; diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index d7019db22fa..be740ce3ae7 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -1756,13 +1756,9 @@ do { \ /* Go to LABEL if ADDR (a legitimate address expression) has an effect that depends on the machine mode it is used for. On the 80386, only postdecrement and postincrement address depend thus - (the amount of decrement or increment being the length of the operand). */ -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \ -do { \ - if (GET_CODE (ADDR) == POST_INC \ - || GET_CODE (ADDR) == POST_DEC) \ - goto LABEL; \ -} while (0) + (the amount of decrement or increment being the length of the operand). + These are now caught in recog.c. */ +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) do {} while (0) /* Max number of args passed in registers. If this is more than 3, we will have problems with ebx (register #4), since it is a caller save register and diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h index 0ec6c96e583..1f1ad890e22 100644 --- a/gcc/config/ia64/ia64.h +++ b/gcc/config/ia64/ia64.h @@ -1403,9 +1403,7 @@ do { \ on the machine mode of the memory reference it is used for or if the address is valid for some modes but not others. */ -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \ - if (GET_CODE (ADDR) == POST_DEC || GET_CODE (ADDR) == POST_INC) \ - goto LABEL; +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) do {} while (0) /* A C expression that is nonzero if X is a legitimate constant for an immediate operand on the target machine. */ diff --git a/gcc/config/m32c/m32c-protos.h b/gcc/config/m32c/m32c-protos.h index ebc4526eef8..b90196b1a4d 100644 --- a/gcc/config/m32c/m32c-protos.h +++ b/gcc/config/m32c/m32c-protos.h @@ -73,7 +73,6 @@ int m32c_legitimize_reload_address (rtx *, MM, int, int, int); rtx m32c_libcall_value (MM); int m32c_limit_reload_class (MM, int); int m32c_memory_move_cost (MM, int, int); -int m32c_mode_dependent_address (rtx); int m32c_modes_tieable_p (MM, MM); bool m32c_mov_ok (rtx *, MM); int m32c_preferred_output_reload_class (rtx, int); diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index 97b095328e4..3a75d99e776 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -1880,15 +1880,6 @@ m32c_legitimize_reload_address (rtx * x, return 0; } -/* Used in GO_IF_MODE_DEPENDENT_ADDRESS. */ -int -m32c_mode_dependent_address (rtx addr) -{ - if (GET_CODE (addr) == POST_INC || GET_CODE (addr) == PRE_DEC) - return 1; - return 0; -} - /* Implements LEGITIMATE_CONSTANT_P. We split large constants anyway, so we can allow anything. */ int diff --git a/gcc/config/m32c/m32c.h b/gcc/config/m32c/m32c.h index 99968f9c442..e42c89108a5 100644 --- a/gcc/config/m32c/m32c.h +++ b/gcc/config/m32c/m32c.h @@ -552,9 +552,7 @@ typedef struct m32c_cumulative_args if (m32c_legitimize_reload_address(&(X),MODE,OPNUM,TYPE,IND_LEVELS)) \ goto win; -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ - if (m32c_mode_dependent_address (ADDR)) \ - goto LABEL; +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) do {} while (0) #define LEGITIMATE_CONSTANT_P(X) m32c_legitimate_constant_p (X) diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h index 4b85a426406..c32da753df7 100644 --- a/gcc/config/m32r/m32r.h +++ b/gcc/config/m32r/m32r.h @@ -1273,10 +1273,7 @@ L2: .word STATIC #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \ do \ { \ - if ( GET_CODE (ADDR) == PRE_DEC \ - || GET_CODE (ADDR) == PRE_INC \ - || GET_CODE (ADDR) == POST_INC \ - || GET_CODE (ADDR) == LO_SUM) \ + if (GET_CODE (ADDR) == LO_SUM) \ goto LABEL; \ } \ while (0) diff --git a/gcc/config/m68hc11/m68hc11.h b/gcc/config/m68hc11/m68hc11.h index 008887bacdd..0019da6c9c5 100644 --- a/gcc/config/m68hc11/m68hc11.h +++ b/gcc/config/m68hc11/m68hc11.h @@ -1239,12 +1239,7 @@ extern unsigned char m68hc11_reg_valid_for_index[FIRST_PSEUDO_REGISTER]; /* Go to LABEL if ADDR (a legitimate address expression) has an effect that depends on the machine mode it is used for. */ -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ -{ \ - if (GET_CODE (ADDR) == PRE_DEC || GET_CODE (ADDR) == POST_DEC \ - || GET_CODE (ADDR) == PRE_INC || GET_CODE (ADDR) == POST_INC) \ - goto LABEL; \ -} +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) do {} while (0) /* Nonzero if the constant value X is a legitimate general operand. It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */ diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h index d6434e61454..80d22012f5d 100644 --- a/gcc/config/m68k/m68k.h +++ b/gcc/config/m68k/m68k.h @@ -839,9 +839,9 @@ __transfer_from_trampoline () \ goto WIN; }}} /* On the 68000, only predecrement and postincrement address depend thus - (the amount of decrement or increment being the length of the operand). */ -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ - if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == PRE_DEC) goto LABEL + (the amount of decrement or increment being the length of the operand). + These are now treated generically in recog.c. */ +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) do {} while (0) #define CASE_VECTOR_MODE HImode #define CASE_VECTOR_PC_RELATIVE 1 diff --git a/gcc/config/mcore/mcore.h b/gcc/config/mcore/mcore.h index d9960dc0edb..233ba97668d 100644 --- a/gcc/config/mcore/mcore.h +++ b/gcc/config/mcore/mcore.h @@ -786,12 +786,7 @@ extern const enum reg_class reg_class_from_letter[]; /* Go to LABEL if ADDR (a legitimate address expression) has an effect that depends on the machine mode it is used for. */ -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ -{ \ - if ( GET_CODE (ADDR) == PRE_DEC || GET_CODE (ADDR) == POST_DEC \ - || GET_CODE (ADDR) == PRE_INC || GET_CODE (ADDR) == POST_INC) \ - goto LABEL; \ -} +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) do {} while (0) /* Specify the machine mode that this machine uses for the index in the tablejump instruction. */ diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h index b102c398306..edfb90e140e 100644 --- a/gcc/config/mn10300/mn10300.h +++ b/gcc/config/mn10300/mn10300.h @@ -777,9 +777,7 @@ while (0) /* Go to LABEL if ADDR (a legitimate address expression) has an effect that depends on the machine mode it is used for. */ -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ - if (GET_CODE (ADDR) == POST_INC) \ - goto LABEL +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) do {} while (0) /* Nonzero if the constant value X is a legitimate general operand. It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */ diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index d3e749a1f64..373b8accf4b 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -1570,12 +1570,7 @@ do { \ /* Go to LABEL if ADDR (a legitimate address expression) has an effect that depends on the machine mode it is used for. */ -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ - if (GET_CODE (ADDR) == PRE_DEC \ - || GET_CODE (ADDR) == POST_DEC \ - || GET_CODE (ADDR) == PRE_INC \ - || GET_CODE (ADDR) == POST_INC) \ - goto LABEL +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) do {} while (0) #define TARGET_ASM_SELECT_SECTION pa_select_section diff --git a/gcc/config/pdp11/pdp11.h b/gcc/config/pdp11/pdp11.h index 09de325b7a9..2ade0ad0f2b 100644 --- a/gcc/config/pdp11/pdp11.h +++ b/gcc/config/pdp11/pdp11.h @@ -760,12 +760,10 @@ extern int may_call_alloca; /* Go to LABEL if ADDR (a legitimate address expression) has an effect that depends on the machine mode it is used for. - On the pdp this is for predec/postinc */ + On the pdp this is for predec/postinc, and this is now treated + generically in recog.c. */ -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ - { if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == PRE_DEC) \ - goto LABEL; \ - } +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) do {} while (0) /* Specify the machine mode that this machine uses diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index db2c7c65f4b..b6deda7e6c2 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -3512,9 +3512,7 @@ rs6000_mode_dependent_address (rtx addr) case LO_SUM: return true; - case PRE_INC: - case PRE_DEC: - return TARGET_UPDATE; + /* Auto-increment cases are now treated generically in recog.c. */ default: break; diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h index d073d7f7c20..cca90f92073 100644 --- a/gcc/config/sh/sh.h +++ b/gcc/config/sh/sh.h @@ -2729,13 +2729,11 @@ struct sh_args { ??? Strictly speaking, we should also include all indexed addressing, because the index scale factor is the length of the operand. However, the impact of GO_IF_MODE_DEPENDENT_ADDRESS would be to - high if we did that. So we rely on reload to fix things up. */ + high if we did that. So we rely on reload to fix things up. -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ -{ \ - if (GET_CODE(ADDR) == PRE_DEC || GET_CODE(ADDR) == POST_INC) \ - goto LABEL; \ -} + Auto-increment addressing is now treated in recog.c. */ + +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) do {} while (0) /* Specify the machine mode that this machine uses for the index in the tablejump instruction. */ diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c index d1f33c7b719..acd57d67c1a 100644 --- a/gcc/config/stormy16/stormy16.c +++ b/gcc/config/stormy16/stormy16.c @@ -704,9 +704,7 @@ xstormy16_mode_dependent_address_p (rtx x) if (GET_CODE (x) == PLUS) x = XEXP (x, 0); - if (GET_CODE (x) == POST_INC - || GET_CODE (x) == PRE_DEC) - return 1; + /* Auto-increment addresses are now treated generically in recog.c. */ return 0; } diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c index 9fc8951ec7e..dc3e0d7e402 100644 --- a/gcc/config/vax/vax.c +++ b/gcc/config/vax/vax.c @@ -1306,8 +1306,8 @@ vax_mode_dependent_address_p (rtx x) { rtx xfoo0, xfoo1; - if (GET_CODE (x) == POST_INC || GET_CODE (x) == PRE_DEC) - return 1; + /* Auto-increment cases are now dealt with generically in recog.c. */ + if (GET_CODE (x) != PLUS) return 0; diff --git a/gcc/recog.c b/gcc/recog.c index 529baa1b5c3..babe04139de 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -1970,8 +1970,17 @@ offsettable_address_p (int strictp, enum machine_mode mode, rtx y) because the amount of the increment depends on the mode. */ int -mode_dependent_address_p (rtx addr ATTRIBUTE_UNUSED /* Maybe used in GO_IF_MODE_DEPENDENT_ADDRESS. */) -{ +mode_dependent_address_p (rtx addr) +{ + /* Auto-increment addressing with anything other than post_modify + or pre_modify always introduces a mode dependency. Catch such + cases now instead of deferring to the target. */ + if (GET_CODE (addr) == PRE_INC + || GET_CODE (addr) == POST_INC + || GET_CODE (addr) == PRE_DEC + || GET_CODE (addr) == POST_DEC) + return 1; + GO_IF_MODE_DEPENDENT_ADDRESS (addr, win); return 0; /* Label `win' might (not) be used via GO_IF_MODE_DEPENDENT_ADDRESS. */ diff --git a/gcc/testsuite/gcc.c-torture/execute/mode-dependent-address.c b/gcc/testsuite/gcc.c-torture/execute/mode-dependent-address.c new file mode 100644 index 00000000000..5bf840cf27c --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/mode-dependent-address.c @@ -0,0 +1,49 @@ +#include <stdint.h> +#include <string.h> +#include <stdlib.h> + +void f883b (int8_t * result, + int16_t * __restrict arg1, + uint32_t * __restrict arg2, + uint64_t * __restrict arg3, + uint8_t * __restrict arg4) +{ + int idx; + for (idx=0;idx<96;idx += 1) { + result[idx] = (((((((((((-27 + 2+1)>>1) || arg4[idx]) < arg1[idx]) + ? (((-27 + 2+1)>>1) || arg4[idx]) + : arg1[idx]) + >> (arg2[idx] & 31)) ^ 1) - -32)>>7) | -5) & arg3[idx]); + } +} + +int8_t result[96]; +int16_t arg1[96]; +uint32_t arg2[96]; +uint64_t arg3[96]; +uint8_t arg4[96]; + +int main (void) +{ + int i; + int correct[] = {0x0,0x1,0x2,0x3,0x0,0x1,0x2,0x3,0x8,0x9,0xa,0xb,0x8,0x9, + 0xa,0xb,0x10,0x11,0x12,0x13,0x10,0x11,0x12,0x13, + 0x18,0x19,0x1a,0x1b,0x18,0x19,0x1a,0x1b,0x20,0x21,0x22, + 0x23,0x20,0x21,0x22,0x23,0x28,0x29,0x2a, + 0x2b,0x28,0x29,0x2a,0x2b,0x30,0x31,0x32,0x33, + 0x30,0x31,0x32,0x33,0x38,0x39,0x3a,0x3b,0x38,0x39,0x3a, + 0x3b,0x40,0x41,0x42,0x43,0x40,0x41,0x42,0x43,0x48,0x49, + 0x4a,0x4b,0x48,0x49,0x4a,0x4b,0x50,0x51, + 0x52,0x53,0x50,0x51,0x52,0x53,0x58,0x59,0x5a,0x5b, + 0x58,0x59,0x5a,0x5b}; + + for (i=0; i < 96; i++) + arg3[i] = arg2[i] = arg1[i] = arg4[i] = i; + + f883b(result, arg1, arg2, arg3, arg4); + + for (i=0; i < 96; i++) + if (result[i] != correct[i]) abort(); + + return 0; +} |