[Patch, Fortran] PR fortran/37099: Wrong simplification of constant character arrays

Daniel Kraft d@domob.eu
Wed Sep 3 18:03:00 GMT 2008


Hi,

simplify_const_ref in expr.c doesn't update the simplified expressions
character length (in the type-spec) when pulling out substring
references.  This caused the problem in PR 37099, because
_gfc_compare_strings was called with a wrong length for the first argument.

This patch fixes the problem by updating the character length in this
case.  No regressions on GNU/Linux-x86-32 (except the graphite ones from
missing cloog).  Ok to commit?  If it is,
should I also backport to 4.3?

Just a remark, I don't quite like the current test's name
(string_compare_1.f90), but it is the only thing I came up with.  Do you
have a better idea?  It's a reduced version of the test attached to the
PR.  Do you think I should include those original tests, too?  (Both
succeed with my fix, of course.)

Yours,
Daniel

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



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


More information about the Fortran mailing list