diff options
author | Michael Hayes <m.hayes@elec.canterbury.ac.nz> | 2004-01-26 00:12:05 +0000 |
---|---|---|
committer | Michael Hayes <m.hayes@gcc.gnu.org> | 2004-01-26 00:12:05 +0000 |
commit | 1e903c616ecfe423377daf798b1213700d0e27b9 (patch) | |
tree | 9ab955841db9be37f272aff1a1029b3ce276f9aa /gcc/config/c4x | |
parent | 3f12cd9b3cfa9d4011eda8a9b469107a59ffe6e0 (diff) | |
download | gcc-1e903c616ecfe423377daf798b1213700d0e27b9.tar.gz |
c4x.c (c4x_check_legit_addr): Rename to c4x_legitimate_address_p.
* config/c4x/c4x.c (c4x_check_legit_addr): Rename to
c4x_legitimate_address_p. Fix post_modify check.
* config/c4x/c4x-protos.h (c4x_check_legit_addr): Adjust.
* config/c4x/c4x.h (c4x_check_legit_addr): Adjust.
From-SVN: r76601
Diffstat (limited to 'gcc/config/c4x')
-rw-r--r-- | gcc/config/c4x/c4x-protos.h | 2 | ||||
-rw-r--r-- | gcc/config/c4x/c4x.c | 6 | ||||
-rw-r--r-- | gcc/config/c4x/c4x.h | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/gcc/config/c4x/c4x-protos.h b/gcc/config/c4x/c4x-protos.h index 36bf96164c1..19ee2d733ed 100644 --- a/gcc/config/c4x/c4x-protos.h +++ b/gcc/config/c4x/c4x-protos.h @@ -68,7 +68,7 @@ extern void c4x_init_builtins (void); #ifdef RTX_CODE extern struct rtx_def *c4x_gen_compare_reg (enum rtx_code, rtx, rtx); -extern int c4x_check_legit_addr (enum machine_mode, rtx, int); +extern int c4x_legitimate_address_p (enum machine_mode, rtx, int); extern int c4x_hard_regno_mode_ok (unsigned int, enum machine_mode); diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c index 28e13359f94..2c46ec1341e 100644 --- a/gcc/config/c4x/c4x.c +++ b/gcc/config/c4x/c4x.c @@ -1432,7 +1432,7 @@ c4x_emit_libcall_mulhi (rtx libcall, enum rtx_code code, int -c4x_check_legit_addr (enum machine_mode mode, rtx addr, int strict) +c4x_legitimate_address_p (enum machine_mode mode, rtx addr, int strict) { rtx base = NULL_RTX; /* Base register (AR0-AR7). */ rtx indx = NULL_RTX; /* Index register (IR0,IR1). */ @@ -1471,7 +1471,9 @@ c4x_check_legit_addr (enum machine_mode mode, rtx addr, int strict) || (GET_CODE (op1) != PLUS && GET_CODE (op1) != MINUS)) return 0; base = XEXP (op1, 0); - if (base != op0) + if (! REG_P (base)) + return 0; + if (REGNO (base) != REGNO (op0)) return 0; if (REG_P (XEXP (op1, 1))) indx = XEXP (op1, 1); diff --git a/gcc/config/c4x/c4x.h b/gcc/config/c4x/c4x.h index ca82dd81216..8ee98a47cc3 100644 --- a/gcc/config/c4x/c4x.h +++ b/gcc/config/c4x/c4x.h @@ -1259,7 +1259,7 @@ CUMULATIVE_ARGS; #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ { \ - if (c4x_check_legit_addr (MODE, X, 0)) \ + if (c4x_legitimate_address_p (MODE, X, 0)) \ goto ADDR; \ } @@ -1275,7 +1275,7 @@ CUMULATIVE_ARGS; #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ { \ - if (c4x_check_legit_addr (MODE, X, 1)) \ + if (c4x_legitimate_address_p (MODE, X, 1)) \ goto ADDR; \ } |