summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaz Kojima <kkojima@gcc.gnu.org>2008-07-15 13:06:32 +0000
committerKaz Kojima <kkojima@gcc.gnu.org>2008-07-15 13:06:32 +0000
commit96c72efecd3d87a178da3ee4b4d0eff5f83f833c (patch)
tree2c23d2b0d8b41f149ef369aec20ebaa7c9ce0fa3
parentcb8cc791fdc4912ebf3cbe935f7912569e4e6ac3 (diff)
downloadgcc-96c72efecd3d87a178da3ee4b4d0eff5f83f833c.tar.gz
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
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/sh/sh.h13
2 files changed, 19 insertions, 0 deletions
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 <kkojima@gcc.gnu.org>
+
+ 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 <andrew_pinski@playstation.sony.com>
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