This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
minor code-quality regression vs. 2.95
- To: gcc at gcc dot gnu dot org
- Subject: minor code-quality regression vs. 2.95
- From: Zack Weinberg <zack at wolery dot cumb dot org>
- Date: Tue, 11 Apr 2000 21:45:41 -0700
This function:
long long blocks (long long bytes) { return bytes / 512; }
compiles as follows with 2.95:
blocks:
movl 4(%esp),%eax
movl 8(%esp),%edx
testl %edx,%edx
jge .L3
addl $511,%eax
adcl $0,%edx
.L3:
shrdl $9,%edx,%eax
sarl $9,%edx
ret
and with the 20000408 CVS tree:
blocks:
movl 8(%esp), %edx
movl 4(%esp), %eax
cmpl $0, %edx
jg .L3
testl %edx, %edx
jns .L3
addl $511, %eax
adcl $0, %edx
.L3:
shrdl $9, %edx, %eax
sarl $9, %edx
ret
Notice the additional compare and test in the 2.96 code.
I can't make any sense at all of the RTL.
zw