https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84394
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2018-02-15
CC| |kargl at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #1 from kargl at gcc dot gnu.org ---
Further reduced testcase
module mod1
implicit none
type :: type1
integer :: i1
end type type1
end module
module mod2
implicit none
contains
subroutine sub1
integer vals
common /block1/ vals(5)
if (any(vals /= [1, 2, 3, 4, 5])) stop 1
end subroutine
end module
block data blkdat
use mod1
integer vals
common /block1/ vals(5)
data vals/1, 2, 3, 4, 5/
end block data blkdat
program main
use mod2, only: sub1
implicit none
call sub1
end program
Looking at
0x7f911f check_conflict
../../gcc/fortran/symbol.c:485
This is really odd. gdb shows
Breakpoint 1, check_conflict (attr=attr@entry=0x203caec38,
name=0x203c22430 "_deallocate", where=where@entry=0x203caec78)
at ../../gcc/gcc/fortran/symbol.c:485
485 gfc_error("%s attribute not allowed in BLOCK DATA program "
(gdb) p *where
$1 = {nextc = 0x0, lb = 0x0}
So, gfortran is inserting a _deallocate (perhaps for a temporary array).
I suspect were can the conflict check for a name starting with an
underscore.