This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gfortran] Fix result pointer variables
- From: Paul Brook <paul at nowt dot org>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>,fortran at gcc dot gnu dot org
- Date: Sat, 11 Oct 2003 21:29:59 +0100
- Subject: [gfortran] Fix result pointer variables
Patch below fixes a failure with function result varables with the pointer
attribute.
Paul
2003-10-11 Feng Wang <wf_cs@yahoo.com>
* trans-expr.c (gfc_conv_variable): Check sym->ts, not the decl.
diff -uprxCVS clean/tree-ssa/gcc/fortran/trans-expr.c gcc/gcc/fortran/
trans-expr.c
--- clean/tree-ssa/gcc/fortran/trans-expr.c +0100
+++ gcc/gcc/fortran/trans-expr.c
@@ -302,7 +302,7 @@ gfc_conv_variable (gfc_se * se, gfc_expr
|| sym->attr.result
|| sym->attr.function
|| !sym->attr.dimension)
- && !GFC_DECL_STRING (se->expr))
+ && sym->ts.type != BT_CHARACTER)
{
se->expr = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (se->expr)),
se->expr);