re PR fortran/46411 (MOVE_ALLOC wrongly rejected as impure)
authorTobias Burnus <burnus@net-b.de>
Wed, 10 Nov 2010 18:04:04 +0000 (19:04 +0100)
committerTobias Burnus <burnus@gcc.gnu.org>
Wed, 10 Nov 2010 18:04:04 +0000 (19:04 +0100)
2010-11-10  Tobias Burnus  <burnus@net-b.de>

        PR fortran/46411
        * intrinsic.c (gfc_intrinsic_sub_interface): Check for attr.pure
        and not for attr.elemental.
        * intrinsic.texi (move_alloc): Document as being pure.

2010-11-10  Tobias Burnus  <burnus@net-b.de>

        PR fortran/46411
        * gfortran.dg/intrinsic_7.f90: New.

From-SVN: r166550

gcc/fortran/ChangeLog
gcc/fortran/intrinsic.c
gcc/fortran/intrinsic.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/intrinsic_7.f90 [new file with mode: 0644]

index d0b003d475cd76d834e466bdf80ecc419a24568d..fe335a99272c5d276bbaf775ed1e843d230e7baa 100644 (file)
@@ -1,3 +1,10 @@
+2010-11-10  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/46411
+       * intrinsic.c (gfc_intrinsic_sub_interface): Check for attr.pure
+       and not for attr.elemental.
+       * intrinsic.texi (move_alloc): Document as being pure.
+
 2010-11-10  Tobias Burnus <burnus@net-b.de>
 
        PR fortran/46244
index f7f0e0506ae50980f48b06b44a07530169bb1c0b..d17544c74b0d3b2c2b814c5e3049f9a24a851209 100644 (file)
@@ -4193,7 +4193,7 @@ gfc_intrinsic_sub_interface (gfc_code *c, int error_flag)
       c->resolved_sym->attr.elemental = isym->elemental;
     }
 
-  if (gfc_pure (NULL) && !isym->elemental)
+  if (gfc_pure (NULL) && !isym->pure)
     {
       gfc_error ("Subroutine call to intrinsic '%s' at %L is not PURE", name,
                 &c->loc);
index 09f52782ab9c080fe5c8065cfb906832978eccb0..3b81c2db6836885a85ab1f53847cdb1a43480f54 100644 (file)
@@ -8977,7 +8977,7 @@ end program
 Fortran 2003 and later
 
 @item @emph{Class}:
-Subroutine
+Pure subroutine
 
 @item @emph{Syntax}:
 @code{CALL MOVE_ALLOC(FROM, TO)}
index 5143d156b09dad3f9d38242f20de7cf58806a84f..ba0a4c129798efbc6accc0eea7429ff1d2281743 100644 (file)
@@ -1,3 +1,8 @@
+2010-11-10  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/46411
+       * gfortran.dg/intrinsic_7.f90: New.
+
 2010-11-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * g++.dg/abi/rtti3.C: Scan for .weakext on alpha*-dec-osf*.
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_7.f90 b/gcc/testsuite/gfortran.dg/intrinsic_7.f90
new file mode 100644 (file)
index 0000000..69bca66
--- /dev/null
@@ -0,0 +1,13 @@
+! { dg-do compile }
+!
+! PR fortran/46411
+!
+! MOVE_ALLOC and other non-elemental but pure
+! procedures where regarded as impure.
+!
+
+pure subroutine test()
+  integer, allocatable :: a, b
+  allocate(a,b)
+  call move_alloc(a,b)
+end subroutine test