From: Ian Lance Taylor <iant@google.com>
To: Edd Barrett <vext01@gmail.com>
Cc: gcc@gcc.gnu.org
Subject: Re: GCC's switch table code generation
Date: Thu, 08 Oct 2009 06:49:00 -0000 [thread overview]
Message-ID: <mcrskduzg0z.fsf@dhcp-172-17-9-151.mtv.corp.google.com> (raw)
In-Reply-To: <a6e8c1d0910071750p7f72a1c3u76be3c29943ea13d@mail.gmail.com> (Edd Barrett's message of "Thu\, 8 Oct 2009 01\:50\:27 +0100")
Edd Barrett <vext01@gmail.com> writes:
> I would be really interested to know how GCC:
> * Decides whether or not to embed tables in the data segment of the binary.
> * Selects the comparisons in the above tree.
The relevant code is expand_case and friends in gcc/stmt.c. Where a
jump table should go is decided on a target by target basis by the
backend macro JUMP_TABLES_IN_TEXT_SECTION.
> Perhaps someone knows of a good paper/book on this topic which could
> be of use, or a relevant section of code in the GCC sources (at the
> moment I am overwhelmed by the source tree).
You may be interested in reading Roger Sayle's paper in the 2008 gcc
summit, linked from http://ols.fedoraproject.org/GCC/Reprints-2008/ .
Ian
next prev parent reply other threads:[~2009-10-08 4:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-08 1:25 Edd Barrett
2009-10-08 6:49 ` Ian Lance Taylor [this message]
2009-10-08 11:21 ` Edd Barrett
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=mcrskduzg0z.fsf@dhcp-172-17-9-151.mtv.corp.google.com \
--to=iant@google.com \
--cc=gcc@gcc.gnu.org \
--cc=vext01@gmail.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).