This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/82267] x32: unnecessary address-size prefixes. Why isn't -maddress-mode=long the default?
- From: "hjl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 24 Sep 2017 21:37:41 +0000
- Subject: [Bug target/82267] x32: unnecessary address-size prefixes. Why isn't -maddress-mode=long the default?
- Auto-submitted: auto-generated
- References: <bug-82267-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82267
--- Comment #3 from hjl at gcc dot gnu.org <hjl at gcc dot gnu.org> ---
Author: hjl
Date: Sun Sep 24 21:37:09 2017
New Revision: 253127
URL: https://gcc.gnu.org/viewcvs?rev=253127&root=gcc&view=rev
Log:
x32: Encode %esp as %rsp to avoid 0x67 prefix
Since the upper 32 bits of stack register are always zero for x32, we
can encode %esp as %rsp to avoid 0x67 prefix in address if there is no
index or base register.
gcc/
PR target/82267
* config/i386/i386.c (ix86_print_operand_address_as): Encode
%esp as %rsp to avoid 0x67 prefix if there is no index or base
register.
gcc/testsuite/
PR target/82267
* gcc.target/i386/pr82267.c: New test.
Added:
trunk/gcc/testsuite/gcc.target/i386/pr82267.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/i386.c
trunk/gcc/testsuite/ChangeLog