Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

MOVE_ALLOC issue

John4
Valued Contributor I
666 Views
When I try to compile the code below, I get an error that points MOVE_ALLOC as a non-pure procedure. Is that the real issue (i.e., a bug), or maybe there's something else wrong in the code that I fail to detect?

Thanks!

[vb]module mod2

    implicit none

contains
    pure subroutine reallocate(array, bound)

        real, allocatable, intent(INOUT) :: array(:)

        real, allocatable :: aux(:)

        integer, intent(IN) :: bound

        integer :: ub



    continue

        if (ALLOCATED(array)) then

            ub = SIZE(array)



             call MOVE_ALLOC(array, aux)

             allocate(array(1:bound))



             array(1:MIN(ub, bound)) = aux(1:MIN(ub, bound))

             deallocate(aux)

        else

            allocate(array(1:bound))

        endif

    end subroutine

end module mod2
[/vb]
0 Kudos
1 Solution
Steven_L_Intel1
Employee
666 Views
Yes - fixed in 11.1.

View solution in original post

0 Kudos
3 Replies
Steven_L_Intel1
Employee
666 Views
Wow. How did we miss that one? Compiler bug. MOVE_ALLOC is pure. It and MVBITS are the only pure intrinsic subroutines. I'll report that to the developers.
0 Kudos
Andrew_Smith
Valued Contributor I
666 Views
Wow. How did we miss that one? Compiler bug. MOVE_ALLOC is pure. It and MVBITS are the only pure intrinsic subroutines. I'll report that to the developers.

Has this been fixed yet?
0 Kudos
Steven_L_Intel1
Employee
667 Views
Yes - fixed in 11.1.
0 Kudos
Reply