[fortran,patch] Fix Fortran wrt --enable-mapped-location

FX Coudert fxcoudert@gmail.com
Fri Sep 14 09:57:00 GMT 2007


Currently, running the gfortran testsuite on a --enable-mapped- 
location build gives some failures, all related to RECORD_TYPEs  
having their type decl or their fields missing source location. My  
patch adds source location information when we have it (user-defined  
type), gives fuzzy location when it's all we can do (see [1]) and,  
for the unions generated directly by the front-end (array  
descriptors, eg), mark them as TYPE_DECL_SUPPRESS_DEBUG (I struggled  
a bit with other approaches before I discovered this flag, but all  
were ugly!).

Bootstrapped on x86_64-linux with --enable-mapped-location, brings  
the testsuite clean (except for do_3.F90). As this is a small patch  
and it's good to get it ASAP to have wide testing of --enable-mapped- 
location (which will be made the default after this is in), I intend  
to commit this in 48 hours, unless it's approved before^W^W^W^Wthere  
are objections ;-)

Thanks,
FX




:ADDPATCH fortran:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mappedloc-fortran.ChangeLog
Type: application/octet-stream
Size: 300 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070914/f602dc74/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mappedloc-fortran.diff
Type: application/octet-stream
Size: 1514 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070914/f602dc74/attachment-0001.obj>
-------------- next part --------------




[1] An example is a member of a derived type declared in a module  
have no source location in scopes where the type is use-associated [2]:
   module foo
      type t
        integer a
      end type t
   end module foo

   use foo
   type(t) :: x

Until location information is stored in the module file itself, all  
we can do is to give them as location the location where the derived  
type itself is used, ie the "type(t) :: x" line. It's better than  
nothing (nothing resulting in a segfault further down the middle-end,  
in dwarf2out.c).

[2] Hope that sentence makes sense, I'm not quite sure about the "use- 
associated" and "scope" language, are these the terms of the standard?


More information about the Gcc-patches mailing list