Module expert needed

Paul Richard Thomas paul.richard.thomas@gmail.com
Tue Aug 4 13:09:00 GMT 2015


Hi FX,

Perhaps you should grab from_intmod from the specific procedure
symbols? A cleaner way, would be to copy mio_symbol and write the
int_mod to the generic interface. However, this would change the
module API.

*** /home/pault/svn/trunk/gcc/fortran/module.c    (revision 226571)
--- /home/pault/svn/trunk/gcc/fortran/module.c    (working copy)
*************** load_generic_interfaces (void)
*** 4499,4504 ****
--- 4499,4507 ----
            sym->attr.generic_copy = 1;
          }

+       if (generic && generic->sym && generic->sym->from_intmod)
+         sym->from_intmod = generic->sym->from_intmod;
+
        /* If a procedure that is not generic has generic interfaces
           that include itself, it is generic! We need to take care
           to retain symbols ambiguous that were already so.  */

should do the job.

Cheers

Paul

On 4 August 2015 at 14:37, FX <fxcoudert@gmail.com> wrote:
>> Thanks! I didn’t realize the generic symbol was the issue. The attached patch sets sym->from_intmod for generic symbols, and fixes the issue. Does that approach seem OK to you?
>
> Nope, I was optimistic. It doesn’t work if the symbol is used in intermediate modules:
>
> module foo
>   use ieee_arithmetic
>   use ieee_exceptions
> end module foo
>
> module bar
>   use foo
> end module
>
> program test
>   use bar
>   logical, parameter :: l2 = ieee_support_flag(ieee_overflow)
> end
>



-- 
Outside of a dog, a book is a man's best friend. Inside of a dog it's
too dark to read.

Groucho Marx



More information about the Fortran mailing list