[Bug c/18219] New: gcc-4.0.0 bloats code by 31%
miguel55angel at hotmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Oct 29 14:00:00 GMT 2004
Hi,
this little function shows an increase in codesize by 31% or 13 byte.
void cdt (int *limit, int *base, int minLen, int maxLen)
{
int i;
for (i = minLen + 1; i <= maxLen; i++)
base[i] = ((limit[i-1] + 1) << 1) - base[i];
}
Size Version Flags
41 3.4.2 -Os
54 4.0.0 -Os -fno-ivopts
63 4.0.0 -Os
3.4.2 disassembly code
00000000 <cdt>:
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 8b 4d 14 mov 0x14(%ebp),%ecx
6: 56 push %esi
7: 8b 55 10 mov 0x10(%ebp),%edx
a: 8b 75 08 mov 0x8(%ebp),%esi
d: 53 push %ebx
e: 8b 5d 0c mov 0xc(%ebp),%ebx
11: 42 inc %edx
12: 39 ca cmp %ecx,%edx
14: 7f 0f jg 25 <cdt+0x25>
16: 8b 44 96 fc mov 0xfffffffc(%esi,%edx,4),%eax
1a: 40 inc %eax
1b: 01 c0 add %eax,%eax
1d: 2b 04 93 sub (%ebx,%edx,4),%eax
20: 89 04 93 mov %eax,(%ebx,%edx,4)
23: eb ec jmp 11 <cdt+0x11>
25: 5b pop %ebx
26: 5e pop %esi
27: 5d pop %ebp
28: c3 ret
4.0.0-20041028 disassembly code
00000000 <cdt>:
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 8b 4d 10 mov 0x10(%ebp),%ecx
6: 57 push %edi
7: 8b 7d 08 mov 0x8(%ebp),%edi
a: 56 push %esi
b: 8b 75 14 mov 0x14(%ebp),%esi
e: 53 push %ebx
f: 8b 5d 0c mov 0xc(%ebp),%ebx
12: 41 inc %ecx
13: 8d 14 8d 00 00 00 00 lea 0x0(,%ecx,4),%edx
1a: eb 11 jmp 2d <cdt+0x2d>
1c: 8b 44 3a fc mov 0xfffffffc(%edx,%edi,1),%eax
20: 41 inc %ecx
21: 40 inc %eax
22: 01 c0 add %eax,%eax
24: 2b 04 1a sub (%edx,%ebx,1),%eax
27: 89 04 1a mov %eax,(%edx,%ebx,1)
2a: 83 c2 04 add $0x4,%edx
2d: 39 f1 cmp %esi,%ecx
2f: 7e eb jle 1c <cdt+0x1c>
31: 5b pop %ebx
32: 5e pop %esi
33: 5f pop %edi
34: 5d pop %ebp
35: c3 ret
This PR may be related to PR17549, but it's much smaller and
hopefully easier to analyse!
--
Summary: gcc-4.0.0 bloats code by 31%
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: miguel55angel at hotmail dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i386-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18219
More information about the Gcc-bugs
mailing list