This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [lto][patch] Don't write DECL_CONTEXT of LABEL_DECLs
On Sat, Jan 24, 2009 at 10:30, Rafael Espindola <espindola@google.com> wrote:
>>> + /* FIXME lto: this might not have been the value seen by the streamer,
>>> + but the context of labels is no longer used. */
>>> + decl->decl_minimal.context = NULL_TREE;
>>
>> Not quite correct. We set the context of every label we see in a
>> GIMPLE_LABEL to the function that is currently being streamed in.
>
> Sorry, what is not quiet correct. The comment or the code?
The comment. The code looks fine.
> We cannot set this to the correct function in here for the same reason
> we cannot write it: we can reach this point via a static variable.
> Fortunately, the value is no longer used after the cfgexpand (no
> regressions in the testsuite at least). Since it is not used, we can
> just set it to NULL_TREE.
Sure. Setting it to NULL_TREE here really doesn't make any
difference, when we read the function body we will set it to
current_function_decl (see the handler for GIMPLE_LABEL statements).
Diego.