From: David Anderson <davea@quasar.engr.sgi.com>
To: gdb@sources.redhat.com
Subject: MIPS stack tracing
Date: Sat, 02 Feb 2002 09:57:00 -0000 [thread overview]
Message-ID: <200202021757.JAA54477@quasar.engr.sgi.com> (raw)
On Thu, Jan 31, 2002 at 05:27:30PM -0500, Don Bowman wrote:
...
> The problem is that the compiler emits multiple returns
> per function. The algorithm gdb follows is that specified
> by the SYSV ABI (which the compiler is breaking). I looked
The only SYSV ABI document on MIPS that I am aware of is the
MIPS Processor Supplement. That document applies to what SGI
calls -32 or o32, the old-32bit ABI.
The section "Standard Called Function Rules" in that document
gives the rule, page 3-18 in my copy.
I am *presuming* that is what you refer to here.
If not, then... the following is 'incomplete'.
Modern gcc (for modern MIPS targets) emits code in
what SGI calls the n32 or 64 ABIs
(or variations thereof, for other MIPS users),
and those ABIs are not defined by the SYSV ABI Mips Processor Supplement!
For these other ABIs, multiple returns per function are allowed and normal.
For non-SGI ABIs the rules are, well, whatever they are.
MIPS is the best source
of info, and "See MIPS Run" by Sweetman has been mentioned by
others here as a good book on MIPS (I concur).
The SGI n32 ABI document is available
for anyone that wishes to see it.
http://techpubs.sgi.com
specifically:
http://techpubs.sgi.com/library/tpl/cgi-bin/browse.cgi?
coll=0650&db=bks&cmd=toc&pth=/SGI_Developer/Mpro_n32_ABI
(I broke that long URL by hand: rejoin it for the URL to work)
Aside: in spite of the ABI rule, the MIPS compilers for the old-32bit
ABI case when -O3 was used always could generate multiple
returns for a function and did at times!! (but -O3 was
relatively rarely used for old-32bit ABI compiles)
For SGI the n32 and 64 ABIs are defined by other SGI documents
(such as the n32 book)
and for other folks using MIPS processors they are defined by
MIPS or whoever 'controls' (whatever that means) the particular
target ABI.
In short, you've been mislead by a document which no longer
applies. gcc is not violating any rule I know of by generating
multiple returns per function.
Corrections welcome.
David Anderson davea@sgi.com
next reply other threads:[~2002-02-02 17:57 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-02 9:57 David Anderson [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-02-07 6:56 Don Bowman
2002-02-07 7:30 ` Daniel Jacobowitz
2002-02-06 9:40 Don Bowman
2002-02-06 16:45 ` Daniel Jacobowitz
2002-02-04 9:22 David Anderson
2002-02-03 15:49 Don Bowman
2002-02-03 12:29 Don Bowman
2002-02-03 12:29 ` Daniel Jacobowitz
2002-02-03 12:29 ` Andrew Cagney
2002-02-03 12:13 ` Daniel Jacobowitz
2002-02-03 12:29 ` Andrew Cagney
2002-02-02 12:14 Don Bowman
2002-02-02 14:45 ` Daniel Jacobowitz
2002-02-02 11:26 Don Bowman
2002-02-02 12:11 ` Stan Shebs
2002-02-02 10:58 David Anderson
2002-02-01 10:15 Don Bowman
2002-02-01 11:32 ` Daniel Jacobowitz
2002-02-02 11:16 ` Greg McGary
2002-01-31 14:27 Don Bowman
2002-02-01 9:37 ` Daniel Jacobowitz
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=200202021757.JAA54477@quasar.engr.sgi.com \
--to=davea@quasar.engr.sgi.com \
--cc=gdb@sources.redhat.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