PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

pgfortran 14.3-0 internal compiler error at -O2 or above

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
layzarc



Joined: 02 Apr 2014
Posts: 6

PostPosted: Sat Apr 05, 2014 12:07 pm    Post subject: pgfortran 14.3-0 internal compiler error at -O2 or above Reply with quote


rMBP~/pgi/bugs$ cat astats.f90
!!!!!!!!!!!!!!!!!!!!!!!!!
subroutine RealArrayStats(name,list,m,array,n,mask,stats)
implicit real(8) (a-h,o-z)
dimension array(m,n),stats(m,-1:2)
character(*),parameter :: FMT='g13.7'
intent(in) name,list,m,array,n,mask; intent(out) stats
character(*) name,list; logical(1) mask(n)
!
! return min,ave,max,rms,p-v stats for each array component
!
parameter (KON=6,ltab=1); character(2),parameter :: TAB=' '//char(9)
dimension a(m),mloc(m,-1:1)
character(4) frc(-1:2)
! logical(1) msk(m,n) !automatic (on stack)
logical(1),allocatable :: msk(:,:) !on heap
character(10) str
logical mess,same; logical,parameter :: FP=FMT(:1)/='i'
dimension l(100)
stats=0; if (ltab<1) return
s=count(mask); if (s==0) return
mess=name/=' '
if (mess) then
i=Num2Char(s,str); call InitializeMeter('calculating '//str(:i)//' '//trim(name)//' statistics')
endif
allocate(msk(m,n)); !msk=spread(mask,1,m) !for large n will overflow stack
do i=1,m; msk(i,:)=mask; enddo !i
mloc(:,0)=0; mloc(:,-1)=minloc(array,2,msk); forall (i=1:m) stats(i,-1)=array(i,mloc(i,-1)); if (mess) call ProgressMeter(25)
a=sum(array,2,msk)/s
if (FP) then; stats(:,0)=a
else; stats(:,0)=nint(a); endif
if (mess) call ProgressMeter(50)
mloc(:,1)=maxloc(array,2,msk); forall (i=1:m) stats(i,1)=array(i,mloc(i,1)); if (mess) call ProgressMeter(75)
forall (i=1:m) a(i)=sqrt(sum((array(i,:)-a(i))**2,msk(i,:))/s) !smaller temporary
if (FP) then; stats(:,2)=a
else; stats(:,2)=nint(a); endif
if (mess) call ProgressMeter(100)
if (list==' ') return
k=ListParse(list,',',l); j=len_trim(list); if (m>1) j=(j-1)/m
if (k==1.and.m>1) then
j=1; l=(/(i,i=0,99)/)
endif
if (FP) then; same=all(real(stats(:,-1))==real(stats(:,1)))
else; same=all(stats(:,-1)==stats(:,1)); endif
if (mess.and..not.same) &
write(KON,'(a,a,5(3x,a7,4x))') TAB(:ltab),repeat(' ',j),'Minimum','Average','Maximum',' RMSvar','Max-Min'
do i=1,m
if (real(stats(i,-1))==real(stats(i,1))) then
write(KON,'(a,a,1x,'//FMT//')') TAB(:ltab),list(l(i)+1:l(i)+j),stats(i,-1)
else
if (FP) then
write(KON,'(a,a,5(1x,'//FMT//'))') TAB(:ltab),list(l(i)+1:l(i)+j),stats(i,:),stats(i,1)-stats(i,-1)
else
frc=' '
do k=-1,1
write(frc(k),'(f4.3)') count(mask.and.array(i,:)==stats(i,k))/s; if (frc(k)=='****') frc(k)=' '
enddo !k
write(KON,'(a,a,5(1x,'//FMT//'))') TAB(:ltab),list(l(i)+1:l(i)+j),(stats(i,k),frc(k),k=-1,2),stats(i,1)-stats(i,-1)
endif
if (ltab>1) write(KON,'(a,a,3(i10.0,4x))') TAB(:ltab),repeat(' ',j),mloc(i,:)
endif
enddo !i
return
end

rMBP~/pgi/bugs$ pgfortran -V -c -O1 astats.f90

pgfortran 14.3-0 64-bit target on Apple OS/X developer
The Portland Group - PGI Compilers and Tools
Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
PGF90/x86-64 OSX 14.3-0
Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
PGF90/x86-64 OSX 14.3-0
Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
rMBP~/pgi/bugs$ pgfortran -V -c -O2 astats.f90

pgfortran 14.3-0 64-bit target on Apple OS/X developer
The Portland Group - PGI Compilers and Tools
Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
PGF90/x86-64 OSX 14.3-0
Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
PGF90/x86-64 OSX 14.3-0
Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
PGF90-S-0000-Internal compiler error. compute_initial_aryaddr: addr not found 1761 (astats.f90: 33)
PGF90-S-0000-Internal compiler error. compute_initial_aryaddr: addr not found 1761 (astats.f90: 33)
0 inform, 0 warnings, 2 severes, 0 fatal for realarraystats
Back to top
View user's profile
cparrott



Joined: 02 May 2011
Posts: 146

PostPosted: Mon Apr 07, 2014 8:56 am    Post subject: Reply with quote

Hi,

I have reproduced your problem here at PGI, and I have filed a report with our developers. I will let you know as soon as this issue has been resolved. Thanks for the report.

Best regards,

+chris
Back to top
View user's profile
jtull



Joined: 30 Jun 2004
Posts: 438

PostPosted: Fri May 02, 2014 10:01 am    Post subject: TPR 20167 - Fortran using forall won't compile at -O2 Reply with quote

This problem has been corrected in the current 14.4 release.

Thanks again for reporting the problem.

regards,
dave
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group