This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Java: fixes for -fno-assume-compiled
Jeff Sturm writes:
> On Sun, 15 Dec 2002, Andrew Haley wrote:
> > Could you explain this next hunk a bit more? It seems to defeat an
> > optimization. Perhaps the optimization didn't work, or didn't help?
>
> Didn't work. Under some circumstances (inner classes), class constants
> were getting compiled into the wrong class's cpool. I suspect
> current_constant_pool_data_ref needed to be cleared somewhere where
> current_class changes, but I didn't look, since...
>
> > > - TYPE_CPOOL_DATA_REF (current_class) = current_constant_pool_data_ref
> > > + TYPE_CPOOL_DATA_REF (current_class) = cpool_data_ref
> > > = build1 (ADDR_EXPR, ptr_type_node, decl);
>
> ...it appears TYPE_CPOOL_DATA_REF also saves this value. If it is already
> saved in a per-class structure, why bother with a global variable?
I see. I guess we should delete the global variable altogether.
The patch is OK.
Andrew.