public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Edd Barrett <vext01@gmail.com>
To: Ian Lance Taylor <iant@google.com>
Cc: Edd Barrett <vext01@gmail.com>, gcc@gcc.gnu.org
Subject: Re: GCC's switch table code generation
Date: Thu, 08 Oct 2009 11:21:00 -0000	[thread overview]
Message-ID: <20091008105432.GA698@edd.kent.ac.uk> (raw)
In-Reply-To: <mcrskduzg0z.fsf@dhcp-172-17-9-151.mtv.corp.google.com>

On Wed, Oct 07, 2009 at 09:05:48PM -0700, Ian Lance Taylor wrote:
> 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.

Many thanks for the pointer
> 
> > 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/ .

Excellent paper. Again many thanks!

-- 
Best Regards
Edd Barrett

http://students.dec.bmth.ac.uk/ebarrett

      reply	other threads:[~2009-10-08 10:56 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
2009-10-08 11:21   ` Edd Barrett [this message]

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=20091008105432.GA698@edd.kent.ac.uk \
    --to=vext01@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=iant@google.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).