This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][AArch64][committed] Add comment on why plus_constant is not used in aarch64_legitimize_reload_address
- From: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 07 Nov 2013 11:48:59 +0000
- Subject: [PATCH][AArch64][committed] Add comment on why plus_constant is not used in aarch64_legitimize_reload_address
- Authentication-results: sourceware.org; auth=none
Hi all,
I've committed this patch as obvious. It adds a comment in
aarch64_legitimize_reload_address explaining that we need the RTL structure to
be preserved before push_reload and using plus_constant would fold that, causing
ICEs.
Thanks,
Kyrill
[gcc/]
2013-11-07 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/aarch64/aarch64.c (aarch64_legitimize_reload_address):
Explain why plus_constant is not used.
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index ee2cb4c..3fe70c1 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -4007,7 +4007,11 @@ aarch64_legitimize_reload_address (rtx *x_p,
cst = force_const_mem (xmode, cst);
/* Reload high part into base reg, leaving the low part
- in the mem instruction. */
+ in the mem instruction.
+ Note that replacing this gen_rtx_PLUS with plus_constant is
+ wrong in this case because we rely on the
+ (plus (plus reg c1) c2) structure being preserved so that
+ XEXP (*p, 0) in push_reload below uses the correct term. */
x = gen_rtx_PLUS (xmode,
gen_rtx_PLUS (xmode, XEXP (x, 0), cst),
GEN_INT (low));