re PR testsuite/77418 (SELECT TYPE associating entity can be (de)allocated)
authorPaul Thomas <pault@gcc.gnu.org>
Wed, 31 Aug 2016 07:50:44 +0000 (07:50 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Wed, 31 Aug 2016 07:50:44 +0000 (07:50 +0000)
2016-08-31  Paul Thomas  <pault@gcc.gnu.org>

PR fortran/77418
* gfortran.dg/dtio_5.f90: Remove the non-standard deallocation
of the associate entity and replace with a pointer to the
intended item on the stack.

From-SVN: r239881

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/dtio_5.f90

index 3d385bdc38b9c4f233663ac21d74e5be5d5f356a..c8b85fa83eaf66b5a6d6ebf606b18e22aff6f8be 100644 (file)
@@ -1,3 +1,10 @@
+2016-08-31  Paul Thomas  <pault@gcc.gnu.org>
+
+       PR fortran/77418
+       * gfortran.dg/dtio_5.f90: Remove the non-standard deallocation
+       of the associate entity and replace with a pointer to the
+       intended item on the stack.
+
 2016-08-31  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
        Paul Thomas  <pault@gcc.gnu.org>
 
index 6381d4ddd985e30fa698ca9ae9e75018a68f0653..8642240c4d5cc7274d17698f00b35868c5498b0b 100644 (file)
@@ -136,6 +136,7 @@ contains
 
   function pop_integer(this) result(item)
     class(integer_stack) :: this
+    class(stack), pointer :: dealloc_item
     integer item
 
     if (this%empty()) then
@@ -149,8 +150,9 @@ contains
           class default
           stop 'Error #1! pop_integer encountered non-integer stack item'
        end select
+       dealloc_item => this%next
        this%next => top%next
-       deallocate(top)
+       deallocate(dealloc_item)
        class default
        stop 'Error #2! pop_integer encountered non-integer_stack item'
     end select