From 96c72efecd3d87a178da3ee4b4d0eff5f83f833c Mon Sep 17 00:00:00 2001 From: Kaz Kojima Date: Tue, 15 Jul 2008 13:06:32 +0000 Subject: [PATCH] re PR target/36780 (Wrong reload generated for subreg address on SH) PR target/36780 * config/sh/sh.h (GO_IF_LEGITIMATE_ADDRESS): Allow (plus (plus (reg) (const_int)) (const_int)) when reload_in_progress. From-SVN: r137838 --- gcc/ChangeLog | 6 ++++++ gcc/config/sh/sh.h | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e0ce324800f..b4df1d50e8c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2008-07-15 Kaz Kojima + + PR target/36780 + * config/sh/sh.h (GO_IF_LEGITIMATE_ADDRESS): Allow + (plus (plus (reg) (const_int)) (const_int)) when reload_in_progress. + 2008-07-15 Andrew Pinski PR target/31568 diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h index 5204847abc5..f8b798d327c 100644 --- a/gcc/config/sh/sh.h +++ b/gcc/config/sh/sh.h @@ -2501,6 +2501,19 @@ struct sh_args { goto LABEL; \ } \ } \ + /* FIXME: This is a temporary hack which should be removed. \ + When reload in progress, find_reloads_subreg_address tries to \ + make a new reload for some types of address. Unfortunately it \ + generates wrong code on SH. See PR36780. The following is to \ + avoid this issue. */ \ + if (!TARGET_SHMEDIA && reload_in_progress \ + && GET_CODE (X) == PLUS \ + && (GET_MODE_SIZE (MODE) == 4 || GET_MODE_SIZE (MODE) == 8) \ + && GET_CODE (XEXP ((X), 0)) == PLUS \ + && GET_CODE (XEXP (XEXP ((X), 0), 1)) == CONST_INT \ + && BASE_REGISTER_RTX_P (XEXP (XEXP ((X), 0), 0)) \ + && GET_CODE (XEXP ((X), 1)) == CONST_INT) \ + goto LABEL; \ } /* Try machine-dependent ways of modifying an illegitimate address -- 2.30.2