diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2008-01-20 08:22:56 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2008-01-20 08:22:56 +0000 |
commit | f2d3cb2501aa64980e32b1ab6ef7179bf64a4dd5 (patch) | |
tree | 9d64879d44fe6ed386e45de8c13efc7841555948 /gcc/fortran/trans-array.c | |
parent | 2045a99abbd89083bbec5826e71c01bacd153dd3 (diff) | |
download | gcc-f2d3cb2501aa64980e32b1ab6ef7179bf64a4dd5.zip gcc-f2d3cb2501aa64980e32b1ab6ef7179bf64a4dd5.tar.gz gcc-f2d3cb2501aa64980e32b1ab6ef7179bf64a4dd5.tar.bz2 |
re PR fortran/34784 (implicit character(s) hides type of selected_int_kind intrinsic)
2008-01-20 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34784
* array.c (gfc_check_constructor_type): Clear the expression ts
so that the checking starts from the deepest level of array
constructor.
* primary.c (match_varspec): If an unknown type is changed to
default character and the attempt to match a substring fails,
change it back to unknown.
PR fortran/34785
* trans-array.c (gfc_add_loop_ss_code) : If ss->string_length is
NULL for an array constructor, use the cl.length expression to
build it.
(gfc_conv_array_parameter): Change call to gfc_evaluate_now to
a tree assignment.
2008-01-20 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34784
* gfortran.dg/array_constructor_20.f90: New test.
* gfortran.dg/mapping_2.f90: Correct ubound expression for h4.
PR fortran/34785
* gfortran.dg/array_constructor_21.f90: New test.
From-SVN: r131675
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r-- | gcc/fortran/trans-array.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 1718ba9..08c2a80 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -1906,6 +1906,18 @@ gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript) break; case GFC_SS_CONSTRUCTOR: + if (ss->expr->ts.type == BT_CHARACTER + && ss->string_length== NULL + && ss->expr->ts.cl + && ss->expr->ts.cl->length) + { + gfc_init_se (&se, NULL); + gfc_conv_expr_type (&se, ss->expr->ts.cl->length, + gfc_charlen_type_node); + ss->string_length = se.expr; + gfc_add_block_to_block (&loop->pre, &se.pre); + gfc_add_block_to_block (&loop->post, &se.post); + } gfc_trans_array_constructor (loop, ss); break; @@ -5042,7 +5054,7 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77) { get_array_ctor_strlen (&se->pre, expr->value.constructor, &tmp); expr->ts.cl->backend_decl = tmp; - se->string_length = gfc_evaluate_now (tmp, &se->pre); + se->string_length = tmp; } /* Is this the result of the enclosing procedure? */ |