Re: code gen for C string literals

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx> 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
>



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux