PR22034

Jan Hubicka jh@suse.cz
Thu Aug 11 00:29:00 GMT 2005


> Jan Hubicka wrote:
> >Hi,
> >The problem is that statics inside classes have TYPEs as contextes.  I 
> >think
> >proper fix is to unwind them up to the containing scope.
> >
> >Bootstrapped/regtested i686-pc-gnu-linux, OK?
> >
> >        /* For local statics lookup proper context die.  */
> >        if (TREE_STATIC (decl) && decl_function_context (decl))
> >! 	{
> >! 	  tree context = DECL_CONTEXT (decl);
> >! 
> >! 	  while (TYPE_P (context))
> >! 	    context = TYPE_CONTEXT (context);
> >! 	  context_die = lookup_decl_die (context);
> >! 	}
> 
> Note that you can then end up with a FUNCTION_DECL as the context again. 
>  Like:
> 
>   void f() {
>    struct S {
>      void g() {
>        struct T {
>          virtual void f();
>        };
>      }
>    }
>  }
> 
> The virtual table for T will be inside lots of things.
> 
> So, don't you need to iterate on both conditions?

Well, I think that in this case the context I should put f() in is g's
internal scope, but perhaps I am wrong here - dwarf is definitly not my
domain :(
I will try to check this out tomorrow unless someone more aware of the
detials explains it...

Honza
> 
> -- 
> Mark Mitchell
> CodeSourcery, LLC
> mark@codesourcery.com
> (916) 791-8304



More information about the Gcc-patches mailing list