public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Robert Dewar <dewar@adacore.com>
To: Sam Lauber <sam124@operamail.com>
Cc: Eric Botcazou <ebotcazou@libertysurf.fr>, gcc@gcc.gnu.org
Subject: Re: Unomitted frame pointers
Date: Sat, 11 Dec 2004 18:10:00 -0000	[thread overview]
Message-ID: <41BB382F.5020606@adacore.com> (raw)
In-Reply-To: <20041211161501.E0D6723CE8@ws5-3.us4.outblaze.com>

Sam Lauber wrote:

Sam, you really don't have the basic knowledge here. You really need to understand
ABI's in general, and the x86 ABI in particular, or you are not going to understand
what is going on.

-fomit-frame-pointer means omit the frame pointer when it is possible. It often
is not possible, in which case the switch is ignored. For example, it obviously
cannot be omitted if there is an alloca call.

> because there is not enough information and documentation

You need to track down the information, you really can't expect to
understand much until you do understand the ABI.

> Why does it have to dynamically align the frame pointer?

Because this is required by the ABI, if you fail to align the stack
pointer, then a lot of code will be unnecessarily ineffcient, and
code using newer instructions (e.g. the new floating-point instructions)
will fail at run time.

> I find your comment a bit insulting

That's actually almost an amusing misunderstanding. Eric did not say that
your machine was obsolete. He said that the generated code was accomodating
an antiquated ABI. That's totally and completely different. He was not
blaming you for anything!

The issue is that the original ABI did not forsee architecture developments.
For example, those requiring greater stack alignment. This is indeed quite
a mess, since you really need this greater alignment. What is happening is
that there are really two ABI's, the old antiquated one, maintained because
old software never dies, and the new one which accomodates the new instructions.
The main procedure in gcc is where the bridge is built between these two ABI's,
which is why the tack has to be dynamically aligned in main.

I assume you do understand alignment requirements in general. If not, you
will really be at sea here. I would recommend reading a book on architecture.

begin shameless plug:
My book "Microprocessors: A Programmers View", with Matthew Smosna, would
probably be at just the right level. It's out of print now, but Amazon lists
used copies from $1.98. [so I am not hunting for royalties here :-)]. One of
these days I should make an updated version of this book.
end shamless plug.

  parent reply	other threads:[~2004-12-11 18:10 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-11 16:15 Sam Lauber
2004-12-11 17:00 ` Eric Botcazou
2004-12-11 18:10 ` Robert Dewar [this message]
2004-12-13  6:16   ` Ranjit Mathew
2004-12-13 14:22     ` Robert Dewar
2004-12-13 23:36     ` Ben Elliston
  -- strict thread matches above, loose matches on Subject: below --
2004-12-11 16:29 Sam Lauber
2004-12-12  1:33 ` Ian Lance Taylor
2004-12-11 16:26 Sam Lauber
2004-12-11 16:42 ` Nathan Sidwell
2004-12-12  0:09 ` Peter Barada
2004-12-11  2:44 Sam Lauber
2004-12-11 15:40 ` Nathan Sidwell
2004-12-11 15:45 ` Andreas Schwab
2004-12-11  2:37 Sam Lauber
2004-12-10 15:44 Thomas R. Truscott
2004-12-10 16:05 ` jlh
2004-12-10 16:25   ` Dave Korn
2004-12-10 16:30     ` Nathan Sidwell
2004-12-10 16:41       ` Dave Korn
2004-12-10 17:54         ` Nathan Sidwell
2004-12-10 16:33     ` Andreas Schwab
2004-12-10 16:40       ` Dave Korn
2004-12-10 16:55       ` Thomas R. Truscott
2004-12-10 17:26         ` Paul Brook
2004-12-11 11:53           ` Kai Henningsen
2004-12-10  5:26 Sam Lauber
2004-12-10  7:22 ` Eric Botcazou
2004-12-10  9:08 ` Richard Guenther

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41BB382F.5020606@adacore.com \
    --to=dewar@adacore.com \
    --cc=ebotcazou@libertysurf.fr \
    --cc=gcc@gcc.gnu.org \
    --cc=sam124@operamail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).