This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

minor code-quality regression vs. 2.95


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]