public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: kevin diggs <diggskevin38@gmail.com>
To: Ian Lance Taylor <iant@google.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: code gen for C string literals
Date: Mon, 14 Feb 2011 16:43:00 -0000	[thread overview]
Message-ID: <AANLkTimCAc-9SxyK=vM2L9hAfzHETBTKNKowRacATu2_@mail.gmail.com> (raw)
In-Reply-To: <mcrhbc7cirs.fsf@google.com>

Hi,

Thanks for the reply.

I did manage to stumble across the gcc internals doc.

"in GENERIC"??? Is this the initial RTL output?

Assuming the size does not bust through a processors offset addressing
capabilities, something similar should be doable for accessing things
in any section (clustered section access optimization). I just figure
that string literals are far more common. Off the top of your head do
you know what I would search for for something like:

int im_a_global_int;

which would be treated similarly to a string literal (at least as far
as how it is accessed), right?

kevin

On Sun, Feb 13, 2011 at 11:00 PM, Ian Lance Taylor <iant@google.com> wrote:
>
> The preprocessor turns a string literal into a CPP_STRING token.  The
> parser turns that into a STRING_CST node in GENERIC.  The RTL expander
> stores the string constant into the constant pool and works with a
> symbol pointing to the address.
>
> This and the various string literal optimizations are scattered across
> various files.  Search for CPP_STRING and STRING_CST to see the kinds of
> things that gcc does.
>
> Ian
>

  reply	other threads:[~2011-02-14 15:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-12 20:20 kevin diggs
2011-02-14  5:10 ` Ian Lance Taylor
2011-02-14 16:43   ` kevin diggs [this message]
2011-02-14 17:47     ` Ian Lance Taylor
2011-02-15 17:25       ` kevin diggs
2011-02-15 19:42         ` Ian Lance Taylor
2011-02-15 20:03           ` kevin diggs
2011-02-15 23:11             ` Ian Lance Taylor

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='AANLkTimCAc-9SxyK=vM2L9hAfzHETBTKNKowRacATu2_@mail.gmail.com' \
    --to=diggskevin38@gmail.com \
    --cc=gcc-help@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).