diff options
author | Oleg Endo <olegendo@gcc.gnu.org> | 2014-07-31 16:27:56 +0000 |
---|---|---|
committer | Oleg Endo <olegendo@gcc.gnu.org> | 2014-07-31 16:27:56 +0000 |
commit | 79a1fe43fb4ed62b9e66c16efe173180423730ee (patch) | |
tree | c91e55166821bbace3d3b2043e0dcae344ccee28 /gcc | |
parent | 6adaaa1d3f343dcf74de60a98cdb931b97659d69 (diff) | |
download | gcc-79a1fe43fb4ed62b9e66c16efe173180423730ee.zip gcc-79a1fe43fb4ed62b9e66c16efe173180423730ee.tar.gz gcc-79a1fe43fb4ed62b9e66c16efe173180423730ee.tar.bz2 |
re PR target/61844 (ICE when building libgcc for sh64 cross-compiler)
gcc/
PR target/61844
* config/sh/sh.c (sh_legitimate_address_p,
sh_legitimize_reload_address): Handle reg+reg address modes when
ALLOW_INDEXED_ADDRESS is false.
* config/sh/predicates.md (general_movsrc_operand,
general_movdst_operand): Likewise.
From-SVN: r213381
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/config/sh/predicates.md | 8 | ||||
-rw-r--r-- | gcc/config/sh/sh.c | 26 |
3 files changed, 43 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b2b6aa5..27ec98e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2014-07-31 Oleg Endo <olegendo@gcc.gnu.org> + + PR target/61844 + * config/sh/sh.c (sh_legitimate_address_p, + sh_legitimize_reload_address): Handle reg+reg address modes when + ALLOW_INDEXED_ADDRESS is false. + * config/sh/predicates.md (general_movsrc_operand, + general_movdst_operand): Likewise. + 2014-07-31 James Greenhalgh <james.greenhalgh@arm.com> * config/aarch64/aarch64-builtins.c diff --git a/gcc/config/sh/predicates.md b/gcc/config/sh/predicates.md index d7251f3..9eb0f1a 100644 --- a/gcc/config/sh/predicates.md +++ b/gcc/config/sh/predicates.md @@ -489,6 +489,10 @@ rtx mem_rtx = MEM_P (op) ? op : SUBREG_REG (op); rtx x = XEXP (mem_rtx, 0); + if (! ALLOW_INDEXED_ADDRESS + && GET_CODE (x) == PLUS && REG_P (XEXP (x, 0)) && REG_P (XEXP (x, 1))) + return false; + if ((mode == QImode || mode == HImode) && GET_CODE (x) == PLUS && REG_P (XEXP (x, 0)) @@ -567,6 +571,10 @@ rtx mem_rtx = MEM_P (op) ? op : SUBREG_REG (op); rtx x = XEXP (mem_rtx, 0); + if (! ALLOW_INDEXED_ADDRESS + && GET_CODE (x) == PLUS && REG_P (XEXP (x, 0)) && REG_P (XEXP (x, 1))) + return false; + if ((mode == QImode || mode == HImode) && GET_CODE (x) == PLUS && REG_P (XEXP (x, 0)) diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 02468da..a19235d 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -10287,6 +10287,10 @@ sh_legitimate_index_p (enum machine_mode mode, rtx op, bool consider_sh2a, static bool sh_legitimate_address_p (enum machine_mode mode, rtx x, bool strict) { + if (! ALLOW_INDEXED_ADDRESS + && GET_CODE (x) == PLUS && REG_P (XEXP (x, 0)) && REG_P (XEXP (x, 1))) + return false; + if (REG_P (x) && REGNO (x) == GBR_REG) return true; @@ -10516,6 +10520,28 @@ sh_legitimize_reload_address (rtx *p, enum machine_mode mode, int opnum, enum reload_type type = (enum reload_type) itype; const int mode_sz = GET_MODE_SIZE (mode); + if (! ALLOW_INDEXED_ADDRESS + && GET_CODE (*p) == PLUS + && REG_P (XEXP (*p, 0)) && REG_P (XEXP (*p, 1))) + { + *p = copy_rtx (*p); + push_reload (*p, NULL_RTX, p, NULL, + BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, opnum, type); + return true; + } + + if (! ALLOW_INDEXED_ADDRESS + && GET_CODE (*p) == PLUS + && GET_CODE (XEXP (*p, 0)) == PLUS) + { + rtx sum = gen_rtx_PLUS (Pmode, XEXP (XEXP (*p, 0), 0), + XEXP (XEXP (*p, 0), 1)); + *p = gen_rtx_PLUS (Pmode, sum, XEXP (*p, 1)); + push_reload (sum, NULL_RTX, &XEXP (*p, 0), NULL, + BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, opnum, type); + return true; + } + if (TARGET_SHMEDIA) return false; |