summaryrefslogtreecommitdiffstats
path: root/gcc/fortran/trans-expr.c
diff options
context:
space:
mode:
authorpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-05 14:06:15 +0000
committerpault <pault@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-05 14:06:15 +0000
commit57dd95f2ad592a2e7b0f01e9d3e75ecf4c03ab51 (patch)
tree83e273fbd1bb9b23ba711ad472cf3a55032e49e3 /gcc/fortran/trans-expr.c
parent63d42079052fc1cdcb30a3e1b8db54a4de3ad3f1 (diff)
downloadppe42-gcc-57dd95f2ad592a2e7b0f01e9d3e75ecf4c03ab51.tar.gz
ppe42-gcc-57dd95f2ad592a2e7b0f01e9d3e75ecf4c03ab51.zip
2007-04-05 Paul Thomas <pault@gcc.gnu.org>
PR fortran/31483 * trans-expr.c (gfc_conv_function_call): Give a dummy procedure the correct type if it has alternate returns. 2007-04-05 Paul Thomas <pault@gcc.gnu.org> PR fortran/31483 * gfortran.dg/altreturn_5.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123518 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r--gcc/fortran/trans-expr.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 036d55bdd28..5ff0c44dfbc 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -2392,17 +2392,23 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
/* Generate the actual call. */
gfc_conv_function_val (se, sym);
+
/* If there are alternate return labels, function type should be
integer. Can't modify the type in place though, since it can be shared
- with other functions. */
+ with other functions. For dummy arguments, the typing is done to
+ to this result, even if it has to be repeated for each call. */
if (has_alternate_specifier
&& TREE_TYPE (TREE_TYPE (TREE_TYPE (se->expr))) != integer_type_node)
{
- gcc_assert (! sym->attr.dummy);
- TREE_TYPE (sym->backend_decl)
- = build_function_type (integer_type_node,
- TYPE_ARG_TYPES (TREE_TYPE (sym->backend_decl)));
- se->expr = build_fold_addr_expr (sym->backend_decl);
+ if (!sym->attr.dummy)
+ {
+ TREE_TYPE (sym->backend_decl)
+ = build_function_type (integer_type_node,
+ TYPE_ARG_TYPES (TREE_TYPE (sym->backend_decl)));
+ se->expr = build_fold_addr_expr (sym->backend_decl);
+ }
+ else
+ TREE_TYPE (TREE_TYPE (TREE_TYPE (se->expr))) = integer_type_node;
}
fntype = TREE_TYPE (TREE_TYPE (se->expr));
OpenPOWER on IntegriCloud