This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug target/19923] openssl is slower when compiled with gcc 4.0 than 3.3


------- Additional Comments From giovannibajo at libero dot it  2005-06-06 14:40 -------
Looks like the culrpit is this:

=========================================================================
static unsigned int S[256];
unsigned
md2_block (unsigned int *sp1, unsigned int *sp2, const unsigned char *d)
{
	register unsigned int t;
	register int i, j;
	static unsigned int state[48];

	j = sp2[16 - 1];
	for (i = 0; i < 16; i++)
	{
		state[i] = sp1[i];
		state[i + 16] = t = d[i];
		state[i + 32] = (t ^ sp1[i]);
		j = sp2[i] ^= S[t ^ j];
	}
}
=========================================================================


gcc 3.4.3 -fPIC -O2:
===================================================
.L5:
	movl	8(%ebp), %esi
	movl	(%esi,%ecx,4), %eax
	movl	%eax, state.0@GOTOFF(%ebx,%ecx,4)
	movl	16(%ebp), %edx
	movzbl	(%edx,%ecx), %eax
	movl	%eax, 64+state.0@GOTOFF(%ebx,%ecx,4)
	movl	(%esi,%ecx,4), %edx
	xorl	%eax, %edx
	movl	-16(%ebp), %esi
	xorl	-20(%ebp), %eax
	movl	%edx, 128+state.0@GOTOFF(%ebx,%ecx,4)
	movl	(%esi,%eax,4), %eax
	xorl	(%edi,%ecx,4), %eax
	movl	%eax, (%edi,%ecx,4)
	incl	%ecx
	cmpl	$15, %ecx
	movl	%eax, -20(%ebp)
	jle	.L5
===================================================



gcc 4.1.0 20050529 -fPIC -O2:
===================================================
.L2:
	movl	8(%ebp), %eax
	leal	0(,%edi,4), %ecx
	movl	%ecx, -28(%ebp)
	addl	%ecx, %eax
	movl	16(%ebp), %ecx
	movl	%eax, %edx
	movl	%eax, -24(%ebp)
	movl	-4(%eax), %eax
	movl	%eax, (%esi)
	movzbl	-1(%ecx,%edi), %eax
	incl	%edi
	movl	%eax, 64(%esi)
	movl	-4(%edx), %ecx
	movl	12(%ebp), %edx
	xorl	%eax, %ecx
	movl	%ecx, 128(%esi)
	movl	-28(%ebp), %ecx
	addl	$4, %esi
	addl	%edx, %ecx
	movl	-16(%ebp), %edx
	xorl	%edx, %eax
	movl	-20(%ebp), %edx
	movl	(%edx,%eax,4), %eax
	movl	-4(%ecx), %edx
	xorl	%edx, %eax
	cmpl	$17, %edi
	movl	%eax, -4(%ecx)
	movl	%eax, -16(%ebp)
	jne	.L2
===================================================


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19923


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