This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/66927] [6.0 regression] ICE in gfc_conf_procedure_call
- From: "vehre at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 18 Jul 2015 13:01:40 +0000
- Subject: [Bug fortran/66927] [6.0 regression] ICE in gfc_conf_procedure_call
- Auto-submitted: auto-generated
- References: <bug-66927-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66927
--- Comment #6 from vehre at gcc dot gnu.org ---
This fixes the issue:
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 6409f7f..181cbce 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -5189,7 +5189,9 @@ gfc_trans_allocate (gfc_code * code)
/* Get the descriptor for all arrays, that are not allocatable or
pointer, because the latter are descriptors already. */
attr = gfc_expr_attr (code->expr3);
- if (code->expr3->rank != 0 && !attr.allocatable && !attr.pointer)
+ if (code->expr3->rank != 0 && ((!attr.allocatable && !attr.pointer)
+ || (code->expr3->expr_type == EXPR_FUNCTION
+ && code->expr3->ts.type != BT_CLASS)))
gfc_conv_expr_descriptor (&se, code->expr3);
else
gfc_conv_expr_reference (&se, code->expr3);