[Patch, Fortran] Fix PRs 36492 and 36517: Wrong error-messages for character array ctors and ICE

Daniel Kraft d@domob.eu
Sat Jun 14 08:32:00 GMT 2008


Hi,

attached is a patch that fixes both PR fortran/36492 and PR
fortran/36517; its an extended version of the patch attached in PR 36517.

To solve the problem with wrong error messages on valid array
constructors I changed the third argument of
gfc_set_constant_character_len from bool array to int check_len; this
allows to check for a common length inside an array constructor that is
not neccessarily equal to the target length of the length change (as was
the problem for PR 36492).  I updated the calls to this function
accordingly and added tests for typespec on the array constructor where
appropriate to disable this check for ctors with typespec.

In decl.c:build_struct I also added additional conditions to a branch
that prevent an ICE on invalid code.  This just skips the branch in this
case as assumptions made would be wrong and the compilation is aborted
with an error message anyway, so we don't need this branch's work.

Regression-tested on GNU/Linux-x86-32, only parameter_array_init_4.f90 
failed, see PR 36534/36535.  I hope it's ok as it is implemented.

Cheers,
Daniel

-- 
Done:     Bar-Sam-Val-Wiz, Dwa-Elf-Hum-Orc, Cha-Law, Fem-Mal
Underway: Ran-Gno-Neu-Fem
To go:    Arc-Cav-Hea-Kni-Mon-Pri-Rog-Tou

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.changelog
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20080614/5d561f88/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20080614/5d561f88/attachment-0001.ksh>


More information about the Fortran mailing list