[patch] Introduce deep unsharing

Eric Botcazou ebotcazou@adacore.com
Fri May 14 22:16:00 GMT 2010


> Hm, but then we modify trees that are visible elsewhere, correct?

No, because we unshare them first in each function.

> I can't really see how gimplifying type-sizes of global types would work
> multiple times.

We don't really gimplify them since we cannot, as gimplifying means creating 
temporaries and therefore requires a function.  Instead we arrange to have 
them unshared in each function and the result gimplified there.

> Correct.  Your patch is certainly a no-op for all languages but Ada,
> but as we gimplify unit-at-a-time can't you do the necessary unsharing
> from inside the frontend?  I obviously miss something (and I will have a
> look at the testcase and its dumps next week).

Yes, but this would essentially mean duplicating what is already done in the 
gimplifier more robustly.  And other front-ends would have to reimplement it.

I can add a big comment in langhooks.h explaining what deep_unsharing is used 
for and the strategy implemented to support global types with variable size.

-- 
Eric Botcazou



More information about the Gcc-patches mailing list