re PR fortran/54389 ([F2003/F2008 difference] PURE functions and pointer dummy argume...
authorTobias Burnus <burnus@net-b.de>
Tue, 28 Aug 2012 18:18:11 +0000 (20:18 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Tue, 28 Aug 2012 18:18:11 +0000 (20:18 +0200)
2012-08-28  Tobias Burnus  <burnus@net-b.de>

        PR fortran/54389
        * trans-decl.c (gfc_get_extern_function_decl,
        build_function_decl): Don't mark impure elemental
        functions as DECL_PURE_P and honour implicit_pure.

From-SVN: r190757

gcc/fortran/ChangeLog
gcc/fortran/trans-decl.c

index 3a6a23e8199a9b18a759070e1772d1642ef0cd85..582eb26f2c0c1c65ac7c972bc1a4f25e1d362b11 100644 (file)
@@ -1,3 +1,10 @@
+2012-08-28  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/54389
+       * trans-decl.c (gfc_get_extern_function_decl,
+       build_function_decl): Don't mark impure elemental
+       functions as DECL_PURE_P and honour implicit_pure.
+
 2012-08-28  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/54382
index 35a859b6d6c2e9ea40aa26bd8555990aa9075222..7e59cb6dcb44c4441714dd3e4b19291daf701244 100644 (file)
@@ -1783,7 +1783,7 @@ gfc_get_extern_function_decl (gfc_symbol * sym)
   /* Set attributes for PURE functions. A call to PURE function in the
      Fortran 95 sense is both pure and without side effects in the C
      sense.  */
-  if (sym->attr.pure || sym->attr.elemental)
+  if (sym->attr.pure || sym->attr.implicit_pure)
     {
       if (sym->attr.function && !gfc_return_by_reference (sym))
        DECL_PURE_P (fndecl) = 1;
@@ -1912,7 +1912,7 @@ build_function_decl (gfc_symbol * sym, bool global)
   /* Set attributes for PURE functions. A call to a PURE function in the
      Fortran 95 sense is both pure and without side effects in the C
      sense.  */
-  if (attr.pure || attr.elemental)
+  if (attr.pure || attr.implicit_pure)
     {
       /* TODO: check if a pure SUBROUTINE has no INTENT(OUT) arguments
         including an alternate return. In that case it can also be