aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2012-09-13 16:57:38 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2012-09-13 16:57:38 +0200
commitc915f8bca422b3e7f76c9e2e87667c516627c728 (patch)
tree456522c8d5e110e07f9646aef6c70490f0d67b68 /gcc/fortran
parentb5c350d82e02bcc202d4c33a8a43cdf65c7d5d2e (diff)
downloadgcc-c915f8bca422b3e7f76c9e2e87667c516627c728.zip
gcc-c915f8bca422b3e7f76c9e2e87667c516627c728.tar.gz
gcc-c915f8bca422b3e7f76c9e2e87667c516627c728.tar.bz2
re PR fortran/54556 (Marking implicitly pure variables as DECL_PURE_P leads to wrong code)
2012-09-13 Tobias Burnus <burnus@net-b.de> PR fortran/54556 * resolve.c (resolve_formal_arglist): Allow VALUE arguments with implicit_pure. (gfc_impure_variable): Don't check gfc_pure such that the function also works for gfc_implicit_pure procedures. 2012-09-13 Tobias Burnus <burnus@net-b.de> PR fortran/54556 * gfortran.dg/implicit_pure_3.f90: New. From-SVN: r191259
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog8
-rw-r--r--gcc/fortran/resolve.c13
2 files changed, 15 insertions, 6 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 45f1c9f..21e7dbe 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,11 @@
+2012-09-13 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/54556
+ * resolve.c (resolve_formal_arglist): Allow VALUE arguments
+ with implicit_pure.
+ (gfc_impure_variable): Don't check gfc_pure such that the
+ function also works for gfc_implicit_pure procedures.
+
2012-09-12 Tobias Burnus <burnus@net-b.de>
PR fortran/54225
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 28eea5d..0748b6a 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -426,10 +426,12 @@ 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->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->value)
proc->attr.implicit_pure = 0;
}
}
@@ -13565,10 +13567,9 @@ gfc_impure_variable (gfc_symbol *sym)
}
proc = sym->ns->proc_name;
- if (sym->attr.dummy && gfc_pure (proc)
- && ((proc->attr.subroutine && sym->attr.intent == INTENT_IN)
- ||
- proc->attr.function))
+ if (sym->attr.dummy
+ && ((proc->attr.subroutine && sym->attr.intent == INTENT_IN)
+ || proc->attr.function))
return 1;
/* TODO: Sort out what can be storage associated, if anything, and include