http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54556
--- Comment #9 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-09-12 21:11:54 UTC --- Untested patch. The first and second part allows VALUE for implicit_pure (in line with F2008 for PURE). The third part is the crucial change: If there is a pointer, assume that the procedure is not implicit_pure. Note: A proper patch should also take BT_CLASS into account - and proc-pointer arguments. --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -426,12 +426,16 @@ resolve_formal_arglist (gfc_symbol *proc) } else if (!sym->attr.pointer) { - if (proc->attr.function && sym->attr.intent != INTENT_IN) + if (proc->attr.function && sym->attr.intent != INTENT_IN + && !sym->attr.value) proc->attr.implicit_pure = 0; - if (proc->attr.subroutine && sym->attr.intent == INTENT_UNKNOWN) + if (proc->attr.subroutine && sym->attr.intent == INTENT_UNKNOWN + && !sym->attr.value) proc->attr.implicit_pure = 0; } + else + proc->attr.implicit_pure = 0; } if (gfc_elemental (proc))