This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/54224] Warn for unused internal procedures
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 03 Nov 2015 14:47:50 +0000
- Subject: [Bug fortran/54224] Warn for unused internal procedures
- Auto-submitted: auto-generated
- References: <bug-54224-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54224
--- Comment #28 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> ---
(In reply to Dominique d'Humieres from comment #27)
> > At some moment, the Fortran FE sets DECL_SOURCE_LOCATION() on a tree,
> > probably using loc->lb->line. Finding out where this happens probably
> > requires a bit of debugging.
>
> /* Set the backend source location of a decl. */
>
> void
> gfc_set_decl_location (tree decl, locus * loc)
> {
> DECL_SOURCE_LOCATION (decl) = loc->lb->location;
> }
>
> in gcc/fortran/trans-decl.c?
I guess you can always try, but yes it looks one place that could be fixed. I
suggest to add a wrapper function. Something like:
location_t
gfc_location_from_locus (const locus * loc)
{
unsigned int offset = loc->nextc - loc->lb->line;
return linemap_position_for_loc_and_offset (line_table,
loc->lb->location,
offset));
}
I think there is at least one place already that could use this wrapper.