[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cc -m486



From: Marc Espie <Marc.Espie@liafa.jussieu.fr>
Subject: Re: cc -m486
Date: Tue, 16 Mar 1999 00:55:29 +0100
> That code change looks weird otherwise. I don't know much about i386, but
> I believe:
> * code 2 is correct
> * the extraneous instructions are weird, the optimizer should remove them.

Code 2.
 1>		.file	"foo.c"
 2>	gcc2_compiled.:
 3>	___gnu_compiled_c:
 4>	.text
 5>		.align 4
 6>	.globl _foo
 7>		.type	 _foo,@function
 8>	_foo:
 9>		pushl %ebp
10>		movl %esp,%ebp
11>		movl 8(%ebp),%eax
12>		addl $5,%eax
13>		movl %ebp,%esp
14>		popl %ebp
15>		ret
16>	Lfe1:
17>		.size	 _foo,Lfe1-_foo

I have checked that the extraneous instructions are removed with
`-fomit-frame-pointer'.  A stack frame is pushed at ll. 9--10 and
poped at ll.13--14.

		Kamo Hiroyasu
		[Kamo is the family name and Hiroyasu the given name.]