re PR fortran/60543 (Function with side effect removed by the optimizer.)
authorTobias Burnus <burnus@net-b.de>
Thu, 20 Mar 2014 06:53:01 +0000 (07:53 +0100)
committerTobias Burnus <burnus@gcc.gnu.org>
Thu, 20 Mar 2014 06:53:01 +0000 (07:53 +0100)
2014-03-19  Tobias Burnus  <burnus@net-b.>

        PR fortran/60543
        * io.c (check_io_constraints): Use gfc_unset_implicit_pure.
        * resolve.c (resolve_ordinary_assign): Ditto.

From-SVN: r208693

gcc/fortran/ChangeLog
gcc/fortran/io.c
gcc/fortran/resolve.c

index 1036716cd429eb96519cd99fb879d056ad73e05e..31353be2796c0f7705f81142676bb727218d41eb 100644 (file)
@@ -1,3 +1,9 @@
+2014-03-19  Tobias Burnus  <burnus@net-b.>
+
+       PR fortran/60543
+       * io.c (check_io_constraints): Use gfc_unset_implicit_pure.
+       * resolve.c (resolve_ordinary_assign): Ditto.
+
 2014-03-19  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/60543
index 8d3dc46f803457a5e8c49140467078777f08546c..84d0db818de3c1f9b62042d8a434a48f5d71f490 100644 (file)
@@ -3259,9 +3259,8 @@ if (condition) \
                     "an internal file in a PURE procedure",
                     io_kind_name (k));
 
-      if (gfc_implicit_pure (NULL) && (k == M_READ || k == M_WRITE))
-       gfc_current_ns->proc_name->attr.implicit_pure = 0;
-
+      if (k == M_READ || k == M_WRITE)
+       gfc_unset_implicit_pure (NULL);
     }
 
   if (k != M_READ)
index ac58167558b53bbeeb418890d0e35c422e476809..6e23e570b179da2e2db8cbf8b1ab82fafe4701c8 100644 (file)
@@ -9165,7 +9165,7 @@ resolve_ordinary_assign (gfc_code *code, gfc_namespace *ns)
       if (lhs->expr_type == EXPR_VARIABLE
            && lhs->symtree->n.sym != gfc_current_ns->proc_name
            && lhs->symtree->n.sym->ns != gfc_current_ns)
-       gfc_current_ns->proc_name->attr.implicit_pure = 0;
+       gfc_unset_implicit_pure (NULL);
 
       if (lhs->ts.type == BT_DERIVED
            && lhs->expr_type == EXPR_VARIABLE
@@ -9173,11 +9173,11 @@ resolve_ordinary_assign (gfc_code *code, gfc_namespace *ns)
            && rhs->expr_type == EXPR_VARIABLE
            && (gfc_impure_variable (rhs->symtree->n.sym)
                || gfc_is_coindexed (rhs)))
-       gfc_current_ns->proc_name->attr.implicit_pure = 0;
+       gfc_unset_implicit_pure (NULL);
 
       /* Fortran 2008, C1283.  */
       if (gfc_is_coindexed (lhs))
-       gfc_current_ns->proc_name->attr.implicit_pure = 0;
+       gfc_unset_implicit_pure (NULL);
     }
 
   /* F2008, 7.2.1.2.  */