This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/50603] [x32] Unnecessary lea
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 03 Oct 2011 20:57:53 +0000
- Subject: [Bug target/50603] [x32] Unnecessary lea
- Auto-submitted: auto-generated
- References: <bug-50603-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50603
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |UNCONFIRMED
Ever Confirmed|1 |0
--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> 2011-10-03 20:57:53 UTC ---
I am testing this patch:
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 7e89dbd..612fcd2 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -15713,6 +15713,16 @@ ix86_fixup_binary_operands (enum rtx_code code, enum
ma
chine_mode mode,
else
src2 = force_reg (mode, src2);
}
+ else
+ {
+ /* Improve address combine in x32 mode. */
+ if (TARGET_X32
+ && code == PLUS
+ && !MEM_P (dst)
+ && !MEM_P (src1)
+ && MEM_P (src2) )
+ src2 = force_reg (mode, src2);
+ }
/* If the destination is memory, and we do not have matching source
operands, do things in registers. */