Bug 67560 - False positive with -fcheck=recursion
Summary: False positive with -fcheck=recursion
Status: RESOLVED DUPLICATE of bug 67505
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 5.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-12 19:54 UTC by Neil Carlson
Modified: 2015-09-12 20:08 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Neil Carlson 2015-09-12 19:54:52 UTC
The following example produces a runtime recursion error during finalization with -fcheck=recursion.  There is indeed recursion, but the final subroutine is declared recursive.

module foo
  type :: list
    type(list), pointer :: next => null()
  contains
    final :: list_delete
  end type
contains
  recursive subroutine list_delete (this)
    type(list), intent(inout) :: this
    if (associated(this%next)) deallocate(this%next)
  end subroutine
end module foo

program main
  use foo
  type(list), pointer :: x
  allocate(x)
  allocate(x%next)
  deallocate(x)
end program
Comment 1 Dominique d'Humieres 2015-09-12 20:08:09 UTC
Duplicate of pr67505.

*** This bug has been marked as a duplicate of bug 67505 ***