[lto][patch] Clear DECL_CONTEXT of PARM_DECL

Diego Novillo dnovillo@google.com
Tue Jan 20 13:58:00 GMT 2009

On Tue, Jan 20, 2009 at 03:38, Rafael Espindola <espindola@google.com> wrote:

> I will try that. An extended proposal:
> 1) Change the reader/writter. This will fix the current bug
> after more important stuff has been done:
> 2) Assert in the writer that DECL_CONTEXT is consistent. This is know
> to fail in some inlined functions. Fix that..
> 3) Make the assertion part of the normal verifier and run it between
> every two passes (after free_decl_lang_specifics)

Sure.  This would address the linking problems, right?  By #1, you
mean never write DECL_CONTEXT in the writer and set DECL_CONTEXT in
the reader according to the current function being streamed in?

>> In fact, we could even do this in the changes to
>> pass_ipa_free_lang_specifics that I'm about to post.  Since we have
>> now switched to traversing the cgraph and varpool nodes, we could make
>> this DECL_CONTEXT change during that traversal.  This way, the writing
>> and reading process would not need to change at all.
> That would have the same problems as my current patch, no?

My thinking was that this is the same thing we would do by refusing to
write DECL_CONTEXT in the writer and instantiating a DECL_CONTEXT from
the current function being read in the reader.  Instead of doing it in
the streamer, we just do it in memory.

However, your plan sounds simpler to get going.  Let's first try steps
1-3 of your extended proposal.  That should address the linking

Thanks for your patience.  Diego.

More information about the Gcc-patches mailing list