https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66822
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|Turn off |Turn -mtune=iamcu for size
|X86_TUNE_ZERO_EXTEND_WITH_A |
|ND for -miamcu |
--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> ---
-mtune=iamcu should be tuned for size. X86_TUNE_ZERO_EXTEND_WITH_AND
lead to bigger size:
[hjl@gnu-tools-1 pr66822]$ cat x.i
unsigned int
foo (unsigned short x)
{
return x;
}
[hjl@gnu-tools-1 pr66822]$ /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -O2 -m32 -miamcu -mtune=iamcu
-c -o x.o x.i -mtune-ctrl=^zero_extend_with_and
[hjl@gnu-tools-1 pr66822]$ objdump -dwr x.o
x.o: file format elf32-i386
Disassembly of section .text:
00000000 <foo>:
0: 0f b7 c0 movzwl %ax,%eax
3: c3 ret
[hjl@gnu-tools-1 pr66822]$ /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -O2 -m32 -miamcu -mtune=iamcu
-c -o x.o x.i -mtune-ctrl=zero_extend_with_and
[hjl@gnu-tools-1 pr66822]$ objdump -dwr x.o
x.o: file format elf32-i386
Disassembly of section .text:
00000000 <foo>:
0: 25 ff ff 00 00 and $0xffff,%eax
5: c3 ret
[hjl@gnu-tools-1 pr66822]$