This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/50659] [4.4/4.5/4.6/4.7 Regression] [F03] ICE with PROCEDURE statement


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 ...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]