[Patch, Fortran] PR31298 - support multiple loading of (renamed) operators in USE

Tobias Burnus burnus@net-b.de
Fri Aug 17 09:28:00 GMT 2007


:ADDPATCH fortran:

This adds support for:

USE mod, only: operator(.op.), operator(.new.)=>operator(.op.),
operator(.another.)=>operator(.op.)

Before only a single rename/import was supported.

The algorithm is partially copied from load_generic_interfaces.

I initially hoped to do:

if(i==1) [...]
     sym = uop->operator->sym
else [...]
    uop->operator->sym = sym

but this fails as sym == NULL. And

if(i==1) [...]
     operator = uop->operator
else [...]
    uop->operator = operator

only works if one disables gfc_free_interface() as otherwise the memory
is deallocated twice.

Build and regression tested on x86-64/Linux. Ok for the trunk?

Tobias

PS: What remains of PR31298 is support for
  operator(+) => operator(.myplus.)
(i.e. intrinsic operator on the left, user operator on the right; the
other way round or renaming intrinsic operators is not allowed.)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: module2.diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20070817/c47d074c/attachment.ksh>


More information about the Fortran mailing list