aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2010-01-05 08:19:30 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2010-01-05 08:19:30 +0100
commit11492349fe6f6a568b3aecdc1a503f80b8848070 (patch)
tree2ae149e5997603aff8300a6d2a76abd2638c2a1a /gcc/fortran
parentab90dbeb085f5ed52528878686c7ba9113d25bc4 (diff)
downloadgcc-11492349fe6f6a568b3aecdc1a503f80b8848070.zip
gcc-11492349fe6f6a568b3aecdc1a503f80b8848070.tar.gz
gcc-11492349fe6f6a568b3aecdc1a503f80b8848070.tar.bz2
re PR fortran/41872 (wrong-code: Issues with allocatable scalars)
2010-01-05 Tobias Burnus <burnus@net-b.de> PR fortran/41872 * trans-expr.c (gfc_conv_procedure_call): Nullify return value for allocatable-scalar character functions. 2010-01-05 Tobias Burnus <burnus@net-b.de> PR fortran/41872 * gfortran.dg/allocatable_scalar_8.f90: New. From-SVN: r155639
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/trans-expr.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 1e6501a..6a59425 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2010-01-05 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/41872
+ * trans-expr.c (gfc_conv_procedure_call): Nullify
+ return value for allocatable-scalar character functions.
+
2010-01-04 Tobias Burnus <burnus@net-b.de>
PR fortran/36161
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 84eb585..e5fce02 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -3351,6 +3351,12 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
{
var = gfc_create_var (type, "pstr");
+ if ((!comp && sym->attr.allocatable)
+ || (comp && comp->attr.allocatable))
+ gfc_add_modify (&se->pre, var,
+ fold_convert (TREE_TYPE (var),
+ null_pointer_node));
+
/* Provide an address expression for the function arguments. */
var = gfc_build_addr_expr (NULL_TREE, var);
}