2 Replies Latest reply: Aug 9, 2012 11:14 PM by santosh.zanjurne RSS

Assertion failure during Loop Nest Optimizer phase

Martin.Stein Newbie
Currently Being Moderated

The following small example yields an error with version 4.2.5.2:

### Assertion failure at line 3637 of /local/home/qa/nightly_build_avx/sandbox/open64/osprey/be/lno/simd.cxx:
### Compiler Error in file Alloc.f90 during Loop Nest Optimizer phase:
### NYI

command line is:

/home/mstein/x86_open64-4.2.5.2/bin/openf95 -O3 -openmp -ftpp -c Alloc.f90 -o Alloc.o

The -march option (tried auto and anyx86) had no influence.

Removing the routine reallocateEnlarge eliminates the compiler error.

 

MODULE Alloc PUBLIC allocateArray, deallocateArray, reallocateEnlarge CONTAINS subroutine allocateArray(ptr, lower, upper, msg) integer(4), dimension(:), pointer, intent(out)& :: ptr integer(4), intent(in)& :: lower, upper character(len=*), intent(in)& :: msg integer(4)& :: iStat allocate(ptr(lower:upper), stat=iStat) if (iStat /= 0) then write(*,*) 'allocation failed; lower, upper', lower, upper write(*,*) msg stop end if end subroutine allocateArray subroutine deallocateArray(ptr, msg) integer(4), dimension(:), pointer, intent(inout)& :: ptr character(len=*), intent(in)& :: msg integer(4)& :: iStat if (associated(ptr)) then deallocate(ptr, stat=iStat) ptr => null() if (iStat /= 0) then write(*,*) 'deallocation failed' write(*,*) msg stop end if end if end subroutine deallocateArray subroutine reallocateEnlarge(ptr, addon, initValue, msg) integer(4), dimension(:), pointer, intent(inout)& :: ptr integer(4), intent(in)& :: addon integer(4), intent(in)& :: initValue character(len=*), intent(in)& :: msg integer(4), dimension(:), pointer& :: ptrNew integer(4)& :: i, lower, upper lower = lbound(ptr,1) upper = ubound(ptr,1) call allocateArray(ptrNew, lower, upper+addon, msg) !$omp parallel default(shared) private(i) !$omp do schedule(static) do i = lower, min(upper, upper+addon) ptrNew(i) = ptr(i) end do !$omp end do if (addon > 0) then !$omp do schedule(static) do i = upper+1,upper+addon ptrNew(i) = initValue end do !$omp end do end if !$omp end parallel call deallocateArray(ptr, msg) ptr => ptrNew end subroutine reallocateEnlarge end MODULE Alloc

More Like This