[patch] Improve support for up-level references (1/n)

Eric Botcazou ebotcazou@adacore.com
Fri May 18 22:22:00 GMT 2018


> +             /* If the next declaration is a PARM_DECL pointing to theDECL,
> +                we need to adjust its VALUE_EXPR directly, since chains of
> +                VALUE_EXPRs run afoul of garbage collection.  This occurs
> +                in Ada for Out parameters that aren't copied in.  */
> +             if (next
> +                 && TREE_CODE (next) == PARM_DECL
> +                 && DECL_HAS_VALUE_EXPR_P (next)
> +                 && DECL_VALUE_EXPR (next) == decl)
> +               SET_DECL_VALUE_EXPR (next, x);
> 
> maybe you can explain the GC issue a bit.

It's the issue with GCed tables pointing to each other (which one is marked 
first?) applied to the VALUE_EXPR table.  Not clear it's worth verifying since 
it's marginal, but I guess it's cheap enough to do in decl_value_expr_insert.

-- 
Eric Botcazou



More information about the Gcc-patches mailing list