diff options
-rw-r--r-- | gcc/fortran/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fortran/iresolve.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/char_length_12.f90 | 12 |
4 files changed, 23 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 436142879da..0161a2a79c9 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2008-05-21 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> + + PR fortran/36257 + * iresolve.c (check_charlen_present): Don't force the rank to 1. + 2008-05-19 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> PR fortran/36265 diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c index 4b7e17d70f3..94ed4a67baf 100644 --- a/gcc/fortran/iresolve.c +++ b/gcc/fortran/iresolve.c @@ -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. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0267b43ff9e..e2e4323a99a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-05-21 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> + + PR fortran/36257 + * gfortran.dg/char_length_12.f90: New test. + 2008-05-20 Nathan Sidwell <nathan@codesourcery.com> * gcc.c-torture/execute/builtins/memops-asm.c: Set inside_main. diff --git a/gcc/testsuite/gfortran.dg/char_length_12.f90 b/gcc/testsuite/gfortran.dg/char_length_12.f90 new file mode 100644 index 00000000000..f22eb6c7229 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/char_length_12.f90 @@ -0,0 +1,12 @@ +! { dg-do run } + + implicit none + character(len=3), dimension(3,3), parameter :: & + p = reshape(["xyz", "abc", "mkl", "vpn", "lsd", "epo", "tgv", & + "bbc", "wto"], [3,3]) + character(len=3), dimension(3,3) :: m1 + + m1 = p + if (any (spread (p, 1, 2) /= spread (m1, 1, 2))) call abort + +end |