[patch, fortran, RFC] Separate READ from WRITE

Tobias Burnus burnus@net-b.de
Sun Oct 10 20:50:00 GMT 2010


  Thomas Koenig wrote:
> this RFC patch separates reads from writes in Fortran, by establishing
> separate transfer functions for writing, with a different spec.  For
> now, the write functions just call the original transfer functions, with
> the spec making all the difference.

I think you are currently trading non-clobber for having a function call 
overhead: The newly generated functions in libgfortran will probably not 
be inlined as the called procedure is also publicly visible. Though, 
they might be cloned and inlined - as least in the cases when the 
transfer function is small.

The question is whether one can do without duplication of code, e.g., by 
having two different decls but with the same assembler name - though, I 
am not sure whether this will work - including with LTO.

What do our middle end experts think?
a) Status quo: Read and write I/O call the same libgfortran function, 
i.e. the non-clobbering is not taken into account.
b) Thomas' patch: Adding a wrapper function for write, i.e. a function 
call overhead but allows to use fn-spec to mark the arguments as noclobber.
c) Other ideas?

Tobias



More information about the Gcc-patches mailing list