[Bug rtl-optimization/67145] New: [6 Regression] Innefective plus-minus simplification
afomin.mailbox at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Aug 7 10:32:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67145
Bug ID: 67145
Summary: [6 Regression] Innefective plus-minus simplification
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: afomin.mailbox at gmail dot com
CC: izamyatin at gmail dot com
Target Milestone: ---
Target: i686
Created attachment 36145
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36145&action=edit
Reproducer
For the loop in the attached test compiled with -O3 -m32 -fPIE -pie after
r224768 we generate 20 insns because of additional copies (first seen at fwprop
pass)
mov (%esp),%edi
mov (%edi),%edx
mov 0x4(%esp),%edi
add %esi,%edx
movzbl (%edx,%ebx,1),%edx
mov %dl,(%ecx,%eax,1)
mov (%edi),%edx
mov 0x8(%esp),%edi
add %ebp,%edx
add (%edi),%edx
mov 0xc(%esp),%edi
movzbl (%edx),%edx
mov %dl,0x1(%ecx,%eax,1)
mov %esi,%edx
add (%edi),%edx
movzbl (%edx,%ebx,1),%edx
mov %dl,0x2(%ecx,%eax,1)
add $0x3,%eax
cmp $0xfffffffd,%eax
jne 50 <foo+0x50>
while for r224767 we generate just 18 insns
mov 0x0(%ebp),%edx
mov 0x4(%esp),%esi
add %ecx,%edx
movzbl (%edx),%edx
mov %dl,(%ebx,%eax,1)
mov %ecx,%edx
add (%esi),%edx
add (%edi),%edx
mov (%esp),%esi
movzbl (%edx),%edx
mov %dl,0x1(%ebx,%eax,1)
mov (%esi),%edx
add %ecx,%edx
movzbl (%edx),%edx
mov %dl,0x2(%ebx,%eax,1)
add $0x3,%eax
cmp $0xfffffffd,%eax
jne 48 <foo+0x48>
Probably this simplification should be tuned for array indices.
More information about the Gcc-bugs
mailing list