This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/84213] [8 Regression] 521.wrf_r from SPEC 2017 fails to build (link) with LTO
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 08 Feb 2018 10:29:17 +0000
- Subject: [Bug lto/84213] [8 Regression] 521.wrf_r from SPEC 2017 fails to build (link) with LTO
- Auto-submitted: auto-generated
- References: <bug-84213-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84213
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
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
DECL_PRESERVE_P?
Trying that (figuring where those decls are created). Pierre-Marie,
maybe you can help here as well.