code gen for C string literals
kevin diggs
diggskevin38@gmail.com
Mon Feb 14 16:43:00 GMT 2011
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
>
More information about the Gcc-help
mailing list