This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/28154] New: SPREAD (and friends) on unallocated arrays
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Jun 2006 19:13:03 -0000
- Subject: [Bug fortran/28154] New: SPREAD (and friends) on unallocated arrays
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This is not a bug (I don't think the code is legal), but surely we could do
better than this:
$ cat zero_spread_2.f90
real,allocatable :: bar(:,:),foo(:)
allocate(foo(0))
bar = spread(foo,dim=1,ncopies=1)
print *, allocated(bar)
end
$ gfortran zero_spread_2.f90 && ./a.out
T
Same goes for most of the transformational intrinsics.
libgfortran/intrinsic/spread_generic.c says:
/* The front end has signalled that we need to populate the return array
descriptor. */
We should really find another way of signaling this to the library (additional
argument?) so that we can perform some checking.
--
Summary: SPREAD (and friends) on unallocated arrays
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: enhancement
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: fxcoudert at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28154