PR69455
dhumieres.dominique@free.fr
dhumieres.dominique@free.fr
Fri Oct 18 14:03:00 GMT 2019
Le 2019-10-18 15:56, Steve Kargl a écrit :
> On Fri, Oct 18, 2019 at 01:01:18PM +0200, dhumieres.dominique@free.fr
> wrote:
>> The patch fixes the problem for iso_c_binding but not for
>> ISO_FORTRAN_ENV (pr69455#c1).
>>
>> The later is fixed with
>>
>> --- ../_clean/gcc/fortran/trans-decl.c 2019-10-11 11:28:20.000000000
>> +0200
>> +++ gcc/fortran/trans-decl.c 2019-10-18 12:52:46.000000000 +0200
>> @@ -5987,7 +5987,12 @@ generate_local_decl (gfc_symbol * sym)
>>
>> if (sym->ns && sym->ns->construct_entities)
>> {
>> - if (sym->attr.referenced)
>> + /* Construction of the ISO_C_BINDING module within a BLOCK
>> + construct where ONLY and RENAMED entities are included in
>> + seems to be bogus. See PR 69455. */
>> + if (sym->attr.referenced
>> + && sym->from_intmod != INTMOD_ISO_C_BINDING
>> + && sym->from_intmod != INTMOD_ISO_FORTRAN_ENV)
>> gfc_get_symbol_decl (sym);
>> sym->mark = 1;
>> }
>>
>> Note that I did not updated the comment nor the test.
>>
>
> If you don't have test code, then how do you know that your
> modification fixes anything? Without a testcase, I'll be
> committing my original patch.
The test case is in pr69455 comment 1:
block
use, intrinsic :: ISO_FORTRAN_ENV, only: wp => REAL32, ik => INT32
print *, ik, wp
end block
block
use, intrinsic :: ISO_FORTRAN_ENV, only: wp => REAL64, ik => INT64
print *, ik, wp
end block
end
Dominique
More information about the Fortran
mailing list