This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, fortran] F2003 - Scalar (re)allocation on assignment and deferred character length scalars.


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


s/dummys/dummies/


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".

Tobias

(* As seen e.g. on comp.lang.fortran, though I saw also reports elsewhere.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]