This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/63469] New: Automatic reallocation of allocatable scalar length even when substring implicitly specified
- From: "davidgkinniburgh at yahoo dot co.uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 06 Oct 2014 22:27:33 +0000
- Subject: [Bug fortran/63469] New: Automatic reallocation of allocatable scalar length even when substring implicitly specified
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63469
Bug ID: 63469
Summary: Automatic reallocation of allocatable scalar length
even when substring implicitly specified
Product: gcc
Version: 4.9.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: davidgkinniburgh at yahoo dot co.uk
CHARACTER(:), ALLOCATABLE :: s
ALLOCATE (character(32) :: s)
s(1:32) = 'string'
print *, 'Length of ', s, ' with substring = ', LEN(s)
s(:) = 'string'
print *, 'Length of ', s, ' with substring = ', LEN(s)
s = 'string'
print *, 'Length of ', s, ' without substring = ', LEN(s)
gfortran (4.9.1 and earlier) gives:
Length of string with substring = 32
Length of string with substring = 6
Length of string without substring = 6
IVF (15.0) gives:
Length of string with substring = 32
Length of string with substring = 32
Length of string without substring = 6
which I think is correct.
It is the implicit definition of both the beginning and the ending of 's' that
seems to do the damage.