aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2006-07-04 20:15:52 +0000
committerPaul Thomas <pault@gcc.gnu.org>2006-07-04 20:15:52 +0000
commit1855915abe6888b17861d36e8174bf954eb8ed86 (patch)
tree2463384e73151c98e251c62c5a975477a2bbcc92 /gcc/fortran/resolve.c
parent6215885d43d8ebe55454794cedfe092604f62718 (diff)
downloadgcc-1855915abe6888b17861d36e8174bf954eb8ed86.zip
gcc-1855915abe6888b17861d36e8174bf954eb8ed86.tar.gz
gcc-1855915abe6888b17861d36e8174bf954eb8ed86.tar.bz2
re PR fortran/28174 (Corruption of multiple character arrays when passing array sections)
2006-07-04 Paul Thomas <pault@gcc.gnu.org> PR fortran/28174 * trans-array.c (gfc_conv_expr_descriptor): When building temp, ensure that the substring reference uses a new charlen. * trans-expr.c (gfc_conv_aliased_arg): Add the formal intent to the argument list, lift the treatment of missing string lengths from the above and implement the use of the intent. (gfc_conv_function_call): Add the extra argument to the call to the above. PR fortran/28167 * trans-array.c (get_array_ctor_var_strlen): Treat a constant substring reference. * array.c (gfc_resolve_character_array_constructor): Remove static attribute and add the gfc_ prefix, make use of element charlens for the expression and pick up constant string lengths for expressions that are not themselves constant. * gfortran.h : resolve_character_array_constructor prototype added. * resolve.c (gfc_resolve_expr): Call resolve_character_array_ constructor again after expanding the constructor, to ensure that the character length is passed to the expression. 2006-07-04 Paul Thomas <pault@gcc.gnu.org> PR fortran/28174 * gfortran.dg/actual_array_substr_2.f90: New test. PR fortran/28167 * gfortran.dg/actual_array_constructor_2.f90: New test. From-SVN: r115182
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 0e9916a..c3aaf87 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -2942,6 +2942,11 @@ gfc_resolve_expr (gfc_expr * e)
gfc_expand_constructor (e);
}
+ /* This provides the opportunity for the length of constructors with character
+ valued function elements to propogate the string length to the expression. */
+ if (e->ts.type == BT_CHARACTER)
+ gfc_resolve_character_array_constructor (e);
+
break;
case EXPR_STRUCTURE: