--- Comment #6 from Richard Biener <rguenth at gcc dot> ---
In the Fortran case the DECL_VALUE_EXPR is
COMPONENT_REF<module_ra_gfdleta.eq.0, em1v>
and rtl_for_decl_location gets to a location via loc_list_from_tree
which eventually looks at DECL_VALUE_EXPR.

I'm quite sure the rev. is responsible for similar Ada -flto -g failures.  We
simply may _not_ add location attributes early.

Note adding a location refering to another entity makes this entity
non-removable.  Well - we kind of rely on late attribute pruning for
removed stuff here in the traditional model.  With LTO we'd need to
invent a new debug hook that tells the middle-end to perserve the
decl because it might have interesting debug info - but that _will_
cause refered stuff to be preserved.

So I think we need to revert this patch and instead make sure those
Ada variables do not get removed?  Like by marking them with

Trying that (figuring where those decls are created).  Pierre-Marie,
maybe you can help here as well.

Reply via email to