This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gfortran] Character variables
- From: Paul Brook <paul at nowt dot org>
- To: "gcc-g95 List" <gcc-g95-devel at lists dot sourceforge dot net>,"gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 14 Sep 2003 19:58:20 +0100
- Subject: [gfortran] Character variables
A couple of bugfixes afecting character variables.
Applied to tree-ssa branch.
2003-09-14 Paul Brook <paul@nowt.org>
* primary.c (gfc_match_rvalue): Make sure sym->result is set.
* trans-expr.c (gfc_conv_string_parameter): Also allow PRAM_DECLs.
diff -urpxCVS clean/tree-ssa/gcc/fortran/primary.c gcc/gcc/fortran/primary.c
--- clean/tree-ssa/gcc/fortran/primary.c 2003-08-02 01:25:05.000000000 +0100
+++ gcc/gcc/fortran/primary.c 2003-09-14 19:39:13.000000000 +0100
@@ -1966,6 +1966,9 @@ gfc_match_rvalue (gfc_expr ** result)
break;
}
+ if (sym->result == NULL)
+ sym->result = sym;
+
m = MATCH_YES;
break;
diff -urpxCVS clean/tree-ssa/gcc/fortran/trans-expr.c gcc/gcc/fortran/trans-expr.c
--- clean/tree-ssa/gcc/fortran/trans-expr.c 2003-08-10 17:29:01.000000000 +0100
+++ gcc/gcc/fortran/trans-expr.c 2003-09-14 19:24:29.000000000 +0100
@@ -1601,7 +1601,8 @@ gfc_conv_string_parameter (gfc_se * se)
if (TYPE_STRING_FLAG (type))
{
assert (TREE_CODE (se->expr) == VAR_DECL
- || TREE_CODE (se->expr) == COMPONENT_REF);
+ || TREE_CODE (se->expr) == COMPONENT_REF
+ || TREE_CODE (se->expr) == PARM_DECL);
TREE_ADDRESSABLE (se->expr) = 1;
se->expr = build1 (ADDR_EXPR, build_pointer_type (type), se->expr);
se->expr = fold (convert (pchar_type_node, se->expr));