- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I get an error, when running the following program compiled with iford 19.0 without any compiler options on linux.
! ifort (IFORT) 19.0.1.144 20181018 program ifort_bug_recursive_type_move_alloc implicit none type stack_t type(stack_t), allocatable :: next end type stack_t type(stack_t), allocatable :: stack, tmp call push(stack) ! in the main program the code works fine call move_alloc(from=stack%next, to=tmp) call move_alloc(from=tmp, to=stack) call push(stack) ! when executed in a subroutine it fails call pop(stack) contains subroutine pop(stack) type(stack_t), intent(in out), allocatable :: stack type(stack_t), allocatable :: tmp !! this pop variant working fine ! call move_alloc(from=stack, to=tmp) ! call move_alloc(from=tmp%next, to=stack) call move_alloc(from=stack%next, to=tmp) ! forrtl: severe (153): allocatable array or pointer is not allocated ! deallocate(stack) ! fixes the bug! call move_alloc(from=tmp, to=stack) end subroutine pop subroutine push(stack) type(stack_t), intent(in out), allocatable :: stack type(stack_t), allocatable :: tmp call move_alloc(from=stack, to=tmp) stack = stack_t() call move_alloc(from=tmp, to=stack%next) end subroutine push end program ifort_bug_recursive_type_move_alloc
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sorry, the error is: forrtl: severe (153): allocatable array or pointer is not allocated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This looks like a bug in Intel Fortran compiler, you should submit a support request at the Intel Online Service Center: https://supporttickets.intel.com/?lang=en-US
The Fortran standard clearly states TO is an INTENT(OUT) dummy argument in MOVE_ALLOC intrinsic subroutine, so you should not have to add the deallocate(stack) instruction prior to invoking this procedure..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This looks very similar to a regression in 19.0.0beta from the earliest point one, which was reported right away, but made it into an update of the beta, the 19.0.0 release, and the first update, 19.0.1, which I commented upon here:
https://software.intel.com/en-us/comment/1929514
Intel Support notified me on Jan 17 that apparently that bug is fixed in the upcoming 19.0.2, so let's see.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tested the program with ifort version 19.0.2.187, the bug is not fixed yet and gives the same error as before.
Do I have to submit a support request if I only want to report the bug, or is this forum thread sufficient.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you should report this regression.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
An update 3 is coming very shortly and is expected to have the anticipated bugfixes.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page