[Bug fortran/68225] New: ICE with -Wrealloc-lhs-all on structure constructor with allocatable components
gerhard.steinmetz.fortran@t-online.de
gcc-bugzilla@gcc.gnu.org
Thu Nov 5 20:47:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68225
Bug ID: 68225
Summary: ICE with -Wrealloc-lhs-all on structure constructor
with allocatable components
Product: gcc
Version: 5.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: gerhard.steinmetz.fortran@t-online.de
Target Milestone: ---
This case aborts with option -Wrealloc-lhs-all :
$ cat y0.f90
program p
type t
integer, allocatable :: a
end type
type(t) :: x
x = t()
print *, allocated(x%a), x%a
end
$ gfortran -g -O0 -Wall -Wrealloc-lhs-all y0.f90
y0.f90:6:0:
x = t()
1
in gfc_format_decoder, at fortran/error.c:1124
---
Without -Wrealloc-lhs-all :
$ gfortran -g -O0 -Wall -fcheck=all -Wrealloc-lhs y0.f90
$ a.out
T 0
Note, F2008 4.5.10 specifies : If an allocatable component has
no corresponding component-data-source, then that component has
an allocation status of unallocated.
More information about the Gcc-bugs
mailing list