PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

pgfortran 13.2 compiler bug

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



Joined: 10 May 2012
Posts: 7

PostPosted: Fri Feb 15, 2013 11:04 am    Post subject: pgfortran 13.2 compiler bug Reply with quote

I have found what seems to be a bug with optimization in
pgfortran 13.2.

It's all explained in this short test code (sorry about the lack
of appropriate spacing).

PROGRAM HLINE
C
C This illustrates a bug in
C pgfortran 13.2-0 64-bit target on x86-64 Linux -tp gh
C
C If you compile as
C pgfortran -g -O1 -o hline hline.F
C and run with inputs 15 20 the output (correct) is
C JD,KD= 15 20
C Indices MS
C 2 2 2 2 2 2 2 2 2 2
C 2 2 2 2 2 2 2 2 3 4
C 5 6 7 8 9 10 11 12 13 14
C Indices ME
C 2 3 4 5 6 7 8 9 10 11
C 12 13 14 14 14 14 14 14 14 14
C 14 14 14 14 14 14 14 14 14 14
C
C If you compile as
C pgfortran -g -O2 -o hline hline.F
C and run with inputs 15 20 the output (incorrect) is
C JD,KD= 15 20
C Indices MS
C 2 2 2 2 -11 -10 -9 -8 2 2
C 2 2 -3 -2 -1 0 2 2 3 4
C 5 6 7 8 9 10 11 12 13 14
C Indices ME
C 14 14 14 14 2 3 4 -3 14 14
C 14 14 10 11 12 21 14 14 14 14
C 18 19 20 13 14 14 14 14 14 14
C
C pgfortran 12.5-0 worked OK for me
C (pgfortran 12.5-0 64-bit target on x86-64 Linux -tp sandybridge)
C
IMPLICIT NONE
INTEGER :: JD,KD
INTEGER :: JS,JE,KS,KE,N
INTEGER, DIMENSION(:), ALLOCATABLE :: MS,ME
C
C
WRITE(*,"('What dimensions JD,KD? ',$)")
READ *,JD,KD
WRITE(*,"('JD,KD=',2I5)") JD,KD
ALLOCATE( MS(JD*KD),ME(JD*KD) )
C
C Integration limits, adjusted for periodicity.
C
JS = 2
JE = JD-1
KS = 2
KE = KD-1
C
C Set up indices for hyper-line.
C
CALL HYPLIN( JS,JE,KS,KE,MS,ME,JD,KD )
C
WRITE(*,"('Indices MS')")
DO N = JS+KS,JE+KE,10
WRITE(*,"(10I5)") MS(N:MIN(N+9,JE+KE))
ENDDO
WRITE(*,"('Indices ME')")
DO N = JS+KS,JE+KE,10
WRITE(*,"(10I5)") ME(N:MIN(N+9,JE+KE))
ENDDO
DEALLOCATE( MS,ME )
C
C
END
C****************************************************************
SUBROUTINE HYPLIN( JS,JE,KS,KE,MS,ME,JD,KD )
C
C Set up indices for hyper-line.
C
IMPLICIT NONE
INTEGER, INTENT (IN) :: JS,JE,KS,KE,JD,KD
INTEGER, DIMENSION(JD*KD), INTENT (OUT) :: MS,ME
C
INTEGER :: M
C
C
DO M = JS+KS,JE+KE
MS(M) = MAX(JS,M-KE)
ME(M) = MIN(JE,M-JS)
ENDDO
C
C
RETURN
END
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6206
Location: The Portland Group Inc.

PostPosted: Fri Feb 15, 2013 11:56 am    Post subject: Reply with quote

Hi Dennis,

Thanks for the report. I was able to reproduce the problem here and have filed a problem report (TPR#19134) with our compiler team. Note that the error appears to only occur on AMD systems when using vectorization. Hence, you can add the flag "-Mnovect" to work around the issue. Also, the error does occur in earlier versions of the compiler when "-Mvect=sse" is added. In PGI 2013, more optimization were added to -O2, including vectorization, and is why you just saw it.

Best Regards,
Mat
Back to top
View user's profile
jtull



Joined: 30 Jun 2004
Posts: 445

PostPosted: Mon Aug 12, 2013 5:24 pm    Post subject: 19134 - UF: -Mvect=sse cause user code to get wrong answers Reply with quote

Dennis,

TPR 19134 has been fixed in the current 13.7 release. Thanks again for your submission.

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