This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC 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
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/