Date: Fri, 24 Aug 2001 15:36:23 -0500 From: Dan Nelson <dnelson@emsphone.com> To: John Baldwin <jhb@FreeBSD.ORG> Cc: Leo Bicknell <bicknell@ufp.org>, "David O'Brien" <obrien@FreeBSD.ORG>, freebsd-hackers@FreeBSD.ORG, Steve Roome <stephen_roome@yahoo.com> Subject: Re: function calls/rets in assembly Message-ID: <20010824153622.A17762@dan.emsphone.com> In-Reply-To: <XFMail.010824133134.jhb@FreeBSD.org> References: <20010824161024.A45122@ussenterprise.ufp.org> <XFMail.010824133134.jhb@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Aug 24), John Baldwin said:
> On 24-Aug-01 Leo Bicknell wrote:
> > Someone suggested to me privately turning on optimization, for the
> > record that doesn't help much: (with -O2)
>
> Actually, it's fairly close to what I proposed. It even axed the
> addl after the call. The only weirdness is the subl/addl dinking
> with gcc. I've no idea what that is about. Perhaps it is using that
> to align code to a certain boundary to optimize the ret inside
> printf? (Make it fetch at the start of a cache line or some such.)
For what it's worth, gcc30 -O produces:
.align 4
.globl printasint
.type printasint,@function
printasint:
pushl %ebp
movl %esp, %ebp
subl $16, %esp
pushl 8(%ebp)
pushl $.LC0
call printf
leave
ret
--
Dan Nelson
dnelson@emsphone.com
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010824153622.A17762>
