x86 -mno-push-args buglet?

John Wehle john@feith.com
Mon Apr 17 22:08:00 GMT 2000


Compiling:

long
func(long long a, long long b)
  {
  long long c;

  c = a / b;

  return c;
  }

with -O2 -S -mno-push-args on an x86 results in:

	pushl	%ebp
	movl	%esp, %ebp
	pushl	%ebx
	subl	$20, %esp
	movl	8(%ebp), %eax
	movl	12(%ebp), %edx
	movl	16(%ebp), %ecx
	movl	20(%ebp), %ebx
	movl	%ebx, 12(%esp)
	movl	%eax, (%esp)
	movl	%edx, 4(%esp)
	movl	%ecx, 8(%esp)
	call	__divdi3
	addl	$16, %esp
	movl	-4(%ebp), %ebx
	leave
	ret

What's the "addl $16,%esp" doing there?

-- John
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------



More information about the Gcc-bugs mailing list