This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[fortran,patch] Fix PR36257, don't force a rank onto an EXPR_ARRAY
- From: FX <fxcoudert at gmail dot com>
- To: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 20 May 2008 14:39:03 +0100
- Subject: [fortran,patch] Fix PR36257, don't force a rank onto an EXPR_ARRAY
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=hPnxNjrrI+4QhsM0BzOATb2JtJPQ5ysoa79rp+qWK9s=; b=R4mxqh9Seo+GDsC/zxblJPMZK7J/2GcAIhOpcy15DczFCf0hrl8pzp3YHQs4y40KFFHaHcmNcX0qMcBSc/lQBTNT2PMslDQoNu7dzra8Zg61r+KNZbv+iWnL87L+wQmtgUiFjDfSmdqVRvu7XtCERegqzh2gE/7UaV97NQ3bdZA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=LMnPC2FYYmLHeh7aUxEDbAVCChlHw2x/dWiMFLE6WhV7OJYg4jkKC4lOnkvqgEo0LiAqPP0k4mKvP5fHn2yPEJoZIOsEMNuK7b5+z1SYfm3TRezEKJ9YrF1qWxiba2OK5cZB8ZnJtO3lOMFSjc06BhzdU5nqLxc6J9ZcLOedxLI=
The following patch fixes PR36257 (that's the wrong-code bug with
SPREAD and parameter character arrays I found while testing my
widechar patch). We used to force the rank of SPREAD or MERGE source
argument to 1 in that very specific case, for a reason I don't
understand. Removing it doesn't break the testsuite, nor does it break
cp2k and other code I could try. As I don't see a reason for forcing
the rank to 1, I'll apply this patch as obvious in a few hours (I just
realized my regtesting was done on a non tree-checking build, and I
prefer doing these with tree checking enabled, so I'll rebootstrap and
reregtest), then commit.
FX
2008-05-20 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/36257
* iresolve.c (check_charlen_present): Don't force the rank to 1.
Index: ../../trunk4/gcc/fortran/iresolve.c
===================================================================
--- ../../trunk4/gcc/fortran/iresolve.c (revision 135395)
+++ ../../trunk4/gcc/fortran/iresolve.c (working copy)
@@ -75,11 +75,8 @@ check_charlen_present (gfc_expr *source)
source->rank = 0;
}
else if (source->expr_type == EXPR_ARRAY)
- {
- source->ts.cl->length =
+ source->ts.cl->length =
gfc_int_expr (source->value.constructor->expr->value.character.length);
- source->rank = 1;
- }
}
/* Helper function for resolving the "mask" argument. */
--
FX Coudert
http://www.homepages.ucl.ac.uk/~uccafco/