This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/50659] [4.4/4.5/4.6/4.7 Regression] [F03] ICE with PROCEDURE statement
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 08 Oct 2011 15:08:25 +0000
- Subject: [Bug fortran/50659] [4.4/4.5/4.6/4.7 Regression] [F03] ICE with PROCEDURE statement
- Auto-submitted: auto-generated
- References: <bug-50659-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50659
--- Comment #11 from janus at gcc dot gnu.org 2011-10-08 15:08:25 UTC ---
Here is an alternative patch to the one in comment #4:
Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c (revision 179710)
+++ gcc/fortran/expr.c (working copy)
@@ -4144,7 +4144,8 @@ replace_symbol (gfc_expr *expr, gfc_symbol *sym, i
if ((expr->expr_type == EXPR_VARIABLE
|| (expr->expr_type == EXPR_FUNCTION
&& !gfc_is_intrinsic (expr->symtree->n.sym, 0, expr->where)))
- && expr->symtree->n.sym->ns == sym->ts.interface->formal_ns)
+ && expr->symtree->n.sym->ns == sym->ts.interface->formal_ns
+ && expr->symtree->n.sym->attr.dummy)
{
gfc_symtree *stree;
gfc_namespace *ns = sym->formal_ns;
We simply forgot to check if the symbol we're replacing is actually a dummy
argument! This even qualifies as obvious, I think ...