[Bug tree-optimization/67213] When compiling for size with -Os loops can get bigger after peeling
fredrik.hederstierna@securitas-direct.com
gcc-bugzilla@gcc.gnu.org
Sat May 6 22:22:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67213
--- Comment #6 from Fredrik Hederstierna <fredrik.hederstierna@securitas-direct.com> ---
Same thing for x86, not only ARM:
bash# gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
bash# gcc -c test.c -Os --param max-completely-peel-times=5
bash# objdump -dath test.o
Disassembly of section .text:
000000000000000f <test_iter_6>:
f: c6 05 00 00 00 00 00 movb $0x0,0x0(%rip) # 16
<test_iter_6+0x7>
16: c6 05 00 00 00 00 01 movb $0x1,0x0(%rip) # 1d
<test_iter_6+0xe>
1d: c6 05 00 00 00 00 02 movb $0x2,0x0(%rip) # 24
<test_iter_6+0x15>
24: c6 05 00 00 00 00 03 movb $0x3,0x0(%rip) # 2b
<test_iter_6+0x1c>
2b: c6 05 00 00 00 00 04 movb $0x4,0x0(%rip) # 32
<test_iter_6+0x23>
32: c6 05 00 00 00 00 05 movb $0x5,0x0(%rip) # 39
<test_iter_6+0x2a>
39: c3 retq
bash# gcc -c test.c -Os --param max-completely-peel-times=4
bash# objdump -dath test.o
Disassembly of section .text:
000000000000000f <test_iter_6>:
f: 31 c0 xor %eax,%eax
11: 88 80 00 00 00 00 mov %al,0x0(%rax)
17: 48 ff c0 inc %rax
1a: 48 83 f8 06 cmp $0x6,%rax
1e: 75 f1 jne 11 <test_iter_6+0x2>
20: c3 retq
More information about the Gcc-bugs
mailing list