This is the mail archive of the
mailing list for the GNU Fortran project.
Re: [Patch, fortran] F2003 - Scalar (re)allocation on assignment and deferred character length scalars.
- From: Tobias Burnus <burnus at net-b dot de>
- To: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- Cc: fortran at gcc dot gnu dot org, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 27 Jan 2011 23:10:31 +0100
- Subject: Re: [Patch, fortran] F2003 - Scalar (re)allocation on assignment and deferred character length scalars.
- References: <AANLkTimxUfvUHPB=LFZEjOCz6Jbu6TMbjtFow-zAZVDN@mail.gmail.com>
Paul Richard Thomas wrote:
It bootstraps and regtests with tonight's trunk, except for:
FAIL: gfortran.dg/gomp/appendix-a/a.23.2.f90 -O (internal compiler error)
FAIL: gfortran.dg/gomp/appendix-a/a.23.2.f90 -O (test for excess errors)
FAIL: gfortran.dg/gomp/appendix-a/a.27.1.f90 -O (internal compiler error)
FAIL: gfortran.dg/gomp/appendix-a/a.27.1.f90 -O (test for excess errors)
That should be fixed by now - however, you might need to bootstrap or at
least "touch omp-low.c" to see the fix as the bug was not in omp-low.c
but the file was "just" miscompiled. Cf. PR 47464.
To the patch:
*************** gfc_conv_procedure_call (gfc_se * se, gf
+ /* Deferred length dummys pass the character length by reference
Otherwise, the patch looks OK.
I think the patch can be committed as everything is guarded by
if(ts.deferred) and thus is save. Additionally, it prevents wrong
code/user confusion: More and more users* expect that reallocate on
assignment is implemented and given that gfortran supports it for
arrays, the chance that they use it also for scalars is even higher,
leading to (seemingly) random segfaults in the user programs. By the
very nature of (re)allocate on assignment, those cases are not compile
time diagnosable - thus, without the patch, one cannot even error out
with "sorry not implemented".
(* As seen e.g. on comp.lang.fortran, though I saw also reports elsewhere.)