The initialization statement
subroutine s8
REAL :: SKEW(10,10) = RESHAPE ( (/ ( 0.0, K = 1,10 ) /), (/ 10, 10 /) )
end subroutine s8
causes the F90 compiler to crash.
pgf90 -c y.f90
pgf90-Fatal-/usr/pgi/linux86/dev/bin/p3/pgf902 TERMINATED by signal 11
/usr/pgi/linux86/dev/bin/p3/pgf902 /tmp/pgf90aaaaaEapat.ilm -fn y.f90 -opt 1 -terse 1
-inform warn -x 51 0x20 -x 119 0xa10000 -x 119 0x100000 -x 122 0x40 -x 123 0x1000
-x 127 4 -x 119 0x40000000 -x 69 4 -x 19 0x400000 -y 80 0x1000 -x 80 0x20000300
-x 124 0x1400 -y 15 2 -y 80 0x1000 -x 80 0x20000300 -x 57 0x3b0000 -x 58 0x48000000
-astype 0 -x 124 1 -cmdline '+pgf90 /tmp/pgf90aaaaaEapat.ilmThe initialization statement
subroutine s8
REAL :: SKEW(10,10) = RESHAPE ( (/ ( 0.0, K = 1,10 ) /), (/ 10, 10 /) )
end subroutine s8
causes the F90 compiler to crash.
pgf90 -c y.f90
pgf90-Fatal-/usr/pgi/linux86/dev/bin/p3/pgf902 TERMINATED by signal 11
subroutine s8
REAL :: SKEW(10,10) = RESHAPE ( (/ ( 0.0, K = 1,10 ) /), (/ 10, 10 /) )
end subroutine s8
causes the F90 compiler to crash.
pgf90 -c y.f90
pgf90-Fatal-/usr/pgi/linux86/dev/bin/p3/pgf902 TERMINATED by signal 11
subroutine s8
REAL :: SKEW(10,10) = RESHAPE ( (/ ( 0.0, K = 1,10 ) /), (/ 10, 10 /) )
end subroutine s8
causes the F90 compiler to crash.
pgf90 -c y.f90
pgf90-Fatal-/usr/pgi/linux86/dev/bin/p3/pgf902 TERMINATED by signal 11
subroutine s8
REAL :: SKEW(10,10) = RESHAPE ( (/ ( 0.0, K = 1,10 ) /), (/ 10, 10 /) )
end subroutine s8
causes the F90 compiler to crash.
pgf90 -c y.f90
pgf90-Fatal-/usr/pgi/linux86/dev/bin/p3/pgf902 TERMINATED by signal 11
subroutine s8
REAL :: SKEW(10,10) = RESHAPE ( (/ ( 0.0, K = 1,10 ) /), (/ 10, 10 /) )
end subroutine s8
causes the F90 compiler to crash.
pgf90 -c y.f90
pgf90-Fatal-/usr/pgi/linux86/dev/bin/p3/pgf902 TERMINATED by signal 11
subroutine s8
REAL :: SKEW(10,10) = RESHAPE ( (/ ( 0.0, K = 1,10 ) /), (/ 10, 10 /) )
end subroutine s8
causes the F90 compiler to crash.
pgf90 -c y.f90
pgf90-Fatal-/usr/pgi/linux86/dev/bin/p3/pgf902 TERMINATED by signal 11
subroutine s8
REAL :: SKEW(10,10) = RESHAPE ( (/ ( 0.0, K = 1,10 ) /), (/ 10, 10 /) )
end subroutine s8
causes the F90 compiler to crash.
pgf90 -c y.f90
pgf90-Fatal-/usr/pgi/linux86/dev/bin/p3/pgf902 TERMINATED by signal 11
subroutine s8
REAL :: SKEW(10,10) = RESHAPE ( (/ ( 0.0, K = 1,10 ) /), (/ 10, 10 /) )
end subroutine s8
causes the F90 compiler to crash.
pgf90 -c y.f90
pgf90-Fatal-/usr/pgi/linux86/dev/bin/p3/pgf902 TERMINATED by signal 11
subroutine s8
REAL :: SKEW(10,10) = RESHAPE ( (/ ( 0.0, K = 1,10 ) /), (/ 10, 10 /) )
end subroutine s8
causes the F90 compiler to crash.
pgf90 -c y.f90
pgf90-Fatal-/usr/pgi/linux86/dev/bin/p3/pgf902 TERMINATED by signal 11
subroutine s8
REAL :: SKEW(10,10) = RESHAPE ( (/ ( 0.0, K = 1,10 ) /), (/ 10, 10 /) )
end subroutine s8
causes the F90 compiler to crash.
pgf90 -c y.f90
pgf90-Fatal-/usr/pgi/linux86/dev/bin/p3/pgf902 TERMINATED by signal 11
% pgf90 -c *.F -V
pgf90 5.2-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2004, STMicroelectronics, Inc. All Rights Reserved.
GLOBAL1_zc.F:
PGF90/any Linux/x86 5.2-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2004, STMicroelectronics, Inc. All Rights Reserved.
PGF90/x86 Linux/x86 5.2-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2004, STMicroelectronics, Inc. All Rights Reserved.
GLOBAL3_st.F:
PGF90/any Linux/x86 5.2-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2004, STMicroelectronics, Inc. All Rights Reserved.
PGF90/x86 Linux/x86 5.2-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2004, STMicroelectronics, Inc. All Rights Reserved.
rotas.F:
PGF90/any Linux/x86 5.2-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2004, STMicroelectronics, Inc. All Rights Reserved.
PGF90/x86 Linux/x86 5.2-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2004, STMicroelectronics, Inc. All Rights Reserved.
% pgf90 -c *.F -V
pgf90 6.0-2 32-bit target on x86 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
GLOBAL1_zc.F:
PGF90/any Linux/x86 6.0-2
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGF90/x86 Linux/x86 6.0-2
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
GLOBAL3_st.F:
PGF90/any Linux/x86 6.0-2
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGF90/x86 Linux/x86 6.0-2
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
rotas.F:
PGF90/any Linux/x86 6.0-2
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
pgf90-Fatal-/usr/pgi_rel/linux86/6.0/bin/p3/pgf901 TERMINATED by signal 11
Arguments to /usr/pgi_rel/linux86/6.0/bin/p3/pgf901
/usr/pgi_rel/linux86/6.0/bin/p3/pgf901 rotas.F -opt 1 -version -terse 1
-inform warn -nohpf -nostatic -x 119 0x100000 -x 19 0x400000 -x 15 2
-x 49 0x400004 -x 51 0x20 -x 57 0x4c -x 58 0x10000 -x 124 0x1000 -x 57 0xfb0000
-x 58 0x78031040 -x 48 3328 -stdinc /usr/pgi_rel/linux86/6.0/include:
/usr/local/include:/usr/lib/gcc-lib/i586-suse-linux/3.3.1/include:/usr/lib/gcc-lib/
i586-suse-linux/3.3.1/include:/usr/include -def unix -def __unix -def __unix__
-def linux -def __linux -def __linux__ -def __inline__= -def i386 -def __i386
-def __i386__ -def __NO_MATH_INLINES -def linux86 -def __THROW= -preprocess
-nofreeform -vect 48 -output /tmp/pgf90eaaaakwraz.ilm
and
% cat bug_demo.f
program bidon
call gllvls (66)
stop
end
subroutine gllvls (nk)
implicit none
integer nk
integer maxdynlv
parameter (maxdynlv = 1000)
real zt(maxdynlv),ztr(maxdynlv),zm(maxdynlv)
common /levelsr/ zt,ztr,zm
integer k
print*, loc(zm(1)),loc(zm(2)),loc(zm(3))
zm=0.
ztr(1)= zm(3)*0.5
print*, loc(zm(1)),loc(zm(2)),loc(zm(3))
stop
return
end
~
% pgf90 -o bug_demo bug_demo.f -O0 -fpic -V
pgf90 6.0-2 32-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGF90/any Linux/x86 6.0-2
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGF90/x86 Linux/x86 6.0-2
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
% bug_demo
134629408 134629412 134629416
134629408 134629412 134629416
FORTRAN STOP
% pgf90 -o bug_demo bug_demo.f -O1 -fpic
% bug_demo
134629408 134629412 134629416
134629408 134629412 134621408 <------------differs
FORTRAN STOP
% more bug7.F90
MODULE YOMSP
IMPLICIT NONE
SAVE
REAL,ALLOCATABLE,TARGET :: SPA3(:,:,:)
REAL,POINTER:: SPVOR(:,:)
REAL,POINTER:: SPT(:,:)
END MODULE YOMSP
MODULE PRFI1B_MOD
CONTAINS
SUBROUTINE PRFI1B(PSP)
IMPLICIT NONE
REAL ,INTENT(IN) :: PSP(:,:)
IF( PSP(1,1) == 123.0 )THEN
write(*,'("PRFI1B: CORRECT")')
ELSE
write(*,'("PRFI1B: WRONG")')
ENDIF
END SUBROUTINE PRFI1B
END MODULE PRFI1B_MOD
MODULE LTINV_MOD
CONTAINS
SUBROUTINE LTINV(PSP)
USE PRFI1B_MOD
IMPLICIT NONE
REAL ,OPTIONAL,INTENT(IN) :: PSP(:,:)
CALL PRFI1B(PSP(:,:))
END SUBROUTINE LTINV
END MODULE LTINV_MOD
PROGRAM BUG7
USE LTINV_MOD
USE YOMSP
allocate(SPA3(1,1,3))
SPVOR => SPA3(1:1,1:1,1)
SPT => SPA3(1:1,1:1,3)
IM=1
SPVOR(1,1)=123.0
CALL LTINV(SPVOR)
SPT(1,1)=123.0
CALL LTINV(SPT)
stop
end
% pgf90 -O0 -o bug7 bug7.F90
armadillo% bug7
PRFI1B: CORRECT
PRFI1B: WRONG
FORTRAN STOP
with other compiler
% f90 -o bug7 bug7.F90
rainier% bug7
PRFI1B: CORRECT
PRFI1B: CORRECT
FORTRAN STOP
Real (LRELZ), Parameter :: ZZ0= 0.0_LRELZ
Real (LRELZ), Parameter :: ZZ1= 1.0_LRELZ
Real (LRELZ), Parameter :: ZZ10= 10.0_LRELZ
!
Integer (LINTZ), Parameter :: MXEXP= 1000_LINTZ
Common /EXPCM / AEX(MXEXP) ,BEX(MXEXP) ,ODXX
Save /EXPCM /
!
Logical, Save :: LDONE= .False.
!-----------------------------------------------------------------------------
!- Calc Coefficients
If ( .not. LDONE ) Then
DXX= ZZ10 / Real (MXEXP,Kind=LRELZ)
ODXX= ZZ1/DXX
XX= ZZ0
!
Y3= ZZ1
Do M= 1,MXEXP
XS= XX
XX= XX + DXX
Y1= Y3
Y3= Exp (-XX)
Y3M1= Y3 - Y1
AEX(M)= Y3M1*ODXX
BEX(M)= Y1 - AEX(M)*XS
End Do
LDONE= .True.
End If
!----------------------------------------------------------- End of Routine --
End Subroutine EXPCOE
% pgf90 -tp=k8-64 -c z.f90 -V -fastsse
pgf90 6.0-2 64-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGF90/any Linux/x86-64 6.0-2
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGF90/x86 Linux/x86-64 6.0-2
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGF90-W-0000-Internal compiler error. llvect: usect not 0, vili 1 (z.f90: 35)
0 inform, 1 warnings, 0 severes, 0 fatal for expcoe
% pgf90 -tp=k8-64 -c z.f90 -V -fast
module transfer_real
integer, parameter :: long=kind(1d0)
contains
subroutine trans
integer :: number
character caux(8)
number = 1
! INTERNAL COMPILER ERROR 1 in staement below
caux = transfer(real(number,long),caux,8)
end subroutine trans
end module transfer_real
module spread_string
contains
subroutine call_spread_st
character(len=50) :: string1
call spread_st(string1)
end subroutine call_spread_st
subroutine spread_st(string)
character(len=*) string
!
! INTERNAL COMPILER ERROR 2 in statement below
call string_array(spread(string,1,1))
end subroutine spread_st
subroutine string_array(array)
character(len=*) :: array(:)
end subroutine string_array
end module spread_string
% pgf90 -c pgi_internal.f90 -V
pgf90 6.0-2 32-bit target on x86 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGF90/any Linux/x86 6.0-2
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGF90-S-0000-Internal compiler error. sym_of_ast: unexpected ast 26 (pgi_internal.f90: 10)
0 inform, 0 warnings, 1 severes, 0 fatal for trans
PGF90-S-0000-Internal compiler error. string_expr_length: ast not string op 14 (pgi_internal.f90: 28)
0 inform, 0 warnings, 1 severes, 0 fatal for spread_st
more bev.c
#include
char *plocal = "n1n2n3n4";
int main()
{
int nnewlines = 0;
while ( *plocal )
{
if ( *plocal++ == 'n' )
{
++nnewlines;
}
}
printf("found new %d new lines\n",nnewlines);
return 0;
}
% pgcc -o bev bev.c -V -O2
pgcc 6.0-2 64-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGC/x86-64 Linux/x86-64 6.0-2
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
% ./bev
found new 3 new lines
% pgcc -o bev bev.c -V -O1
pgcc 6.0-2 64-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGC/x86-64 Linux/x86-64 6.0-2
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
% ./bev
found new 4 new lines
4 is the correct answer.
Works with -O2 on 32-bit.
% more grid1.f
module grid1
implicit none
integer nb/1/
end module grid1
% pgf90 -c grid1.f -V
pgf90 6.0-2 32-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGF90/any Linux/x86 6.0-2
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
pgf90-Fatal-/usr/pgi_rel/linux86/6.0/bin/pgf901 TERMINATED by signal 11
Arguments to /usr/pgi_rel/linux86/6.0/bin/pgf901
/usr/pgi_rel/linux86/6.0/bin/pgf901 grid1.f -opt 1 -version -terse 1 -inform warn -nohpf -nostatic -x 119 0x100000 -x 19 0x400000 -x 59 4 -x 15 2 -x 49 0x400004 -x 51 0x20 -x 57 0x4c -x 58 0x10000 -x 124 0x1000 -x 57 0xfb0000 -x 58 0x78031040 -x 48 3328 -stdinc /usr/pgi_rel/linux86/6.0/include:/usr/local/include:/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/include:/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/32/include:/usr/include -def unix -def __unix -def __unix__ -def linux -def __linux -def __linux__ -def __inline__= -def i386 -def __i386 -def __i386__ -def __NO_MATH_INLINES -def linux86 -def __THROW= -nofreeform -vect 48 -output /tmp/pgf90aaaaagbeaa.ilm
The compiler should report the error and fail gracefully.
The win32 f90 compiler emitted a dwarf2 label for every module that
was not compiled with -g. This was a bug; these labels should only
be generated for targets that support dwarf2.
program forall_bug
implicit none
integer :: i, a(5), b(5), ibuf(5)
character(len=5) :: word1='abcde', word2
do i=1,5
a(i)=i
end do
write(*,*) a
forall (i=1:5) b(i)=2*a(i)
write(*,*) b
forall(i=1:5) ibuf(i)=iachar(word1(i:i))
forall(i=1:5) word2(i:i)=achar(ibuf(i))
!!$ do i=1,5
!!$ word2(i:i)=achar(ibuf(i))
!!$ end do
write(*,*) word1
write(*,*) word2
stop
end program forall_bug
% pgf90 -c *.f90 -V
pgf90 6.0-4 32-bit target on x86 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGF90/any Linux/x86 6.0-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGF90-W-0000-Internal compiler error. add_stmt_before: sees ast of 0 0 (forall_bug.f90: 17)
PGF90-W-0000-Internal compiler error. rewrite_sub_ast: unexpected ast 58 (forall_bug.f90)
PGF90-F-0000-Internal compiler error. rewrite_subroutine: unknown stmt found 0 (forall_bug.f90: -1)
PGF90/any Linux/x86 6.0-4: compilation aborted
In PGI 6.0-1, the '-Wc,-tlocal' is noted to be deprecated. Instead of
returning a message to note this fact, the following error occurs:
$ cat t0.C
#include
using namespace std;
int main() {
int count = 1;
cout << "count is set to: " << count << endl;
return 0;
}
$ pgCC -Wc,-tlocal t0.C
/tmp/pgCCbaaaakxpao.s: Assembler messages:
/tmp/pgCCbaaaakxpao.s:1786: Error: symbol
`id__Q2_3std84num_put__tm__69_cQ2_3std
58ostreambuf_iterator__tm__31_cQ2_3std20char_traits__tm__2_c' is already
defined
/tmp/pgCCbaaaakxpao.s:1786: Warning: rest of line ignored; first ignored
charact
er is `,'
-O2 optimization in pfCC was dsicovered and corrected.
A suggestion by a user that our default OpenMP behavior be to run
the same number of threads as cpus. We have declined at this time, but we
can suggest users try
call omp_set_num_threads(omp_get_num_procs())
to accomplish this same goal.
JAVA 1.4 was showing problems in pgdbg. We have replaced it with the 1.5 version.
% make
pgf90 *.f90 -Mpreprocess -o treecode
classes.f90:
header.f90:
PGF90-W-0006-Input file empty (header.f90)
PGF90/any Linux/x86 6.0-4: compilation completed with warnings
main.f90:
particle.f90:
treenode.f90:
Lowering Error: unknown operator for LHS or argument [ast=0,asttype=0,datatype=0]
PGF90-F-0000-Internal compiler error. Errors in Lowering 1 (treenode.f90: 143)
PGF90/any Linux/x86 6.0-4: compilation aborted
make: *** [treecode] Error 2
% pgcc -c sub1.c
% pgf90 -o m1 m1.F90 sub1.o -V
% ./m1
Segmentation fault
% more m1.F90
program main
implicit none
integer kdd
integer eom
call sub1(4,'DOTDOT',kdd,eom)
call sub1(4,'DOTDOT',kdd,eom)
end
% more sub1.c
#include
void sub1_(int *n, ...) {
void *fargs[35];
char *fmsg;
int i;
va_list args;
va_start(args, n);
fargs[0] = n;
for(i=1; i <= *n; i++)
fargs[i] = va_arg(args, void *);
va_end(args);
fmsg = fargs[1];
}
Compiling -Mvarargs corrects the seg fault.
Example code:
program test
implicit none
logical a, b
a = .true.
b = .not.a
write(*,*) 'a =', a, 'b =', b
end
Appears to work in dev -Munixlogical fails; without it passes
% pgf90 -o test test.f -V
pgf90 6.0-4 32-bit target on x86 Linux
% ./test
a = T b = F
% pgf90 -o test test.f -Munixlogical -V
pgf90 6.0-4 32-bit target on x86 Linux
% test
a = T b = T
% setdev
% pgf90 -o test test.f -Munixlogical -V
pgf90 Rel Dev 32-bit target on x86 Linux
% ./test
a = T b = F
program where_test
integer, parameter :: nb = 2
real(kind(1.0d0)), dimension(:), pointer :: res_tol, res_norm
allocate( res_tol(nb), res_norm(nb) )
res_tol = 1.0d0
res_norm = 1.0d0
where (0.0d0 < res_tol) res_norm = 2.0d0
print*, "res_norm =", res_norm
deallocate(res_tol, res_norm)
stop
end program where_test
% pgf90 -o where where_test.f90 -V
pgf90 6.0-4 64-bit target on x86-64 Linux
% ./where
res_norm = 2.000000000000000 2.000000000000000
FORTRAN STOP
% pgf90 -o where where_test.f90 -V -O2
pgf90 6.0-4 64-bit target on x86-64 Linux
% ./where
res_norm = 1.000000000000000 1.000000000000000
FORTRAN STOP
Fails at -O2
% pgcc -o myname myname.c -Mmpi -v
libfmpich.so: undefined reference to `getarg_'
libfmpich.so: undefined reference to `iargc_'
pgcc-Fatal-linker completed with exit code 1
pgcc -Mmpi for x86-64 needs to add -lpgftnrtl
program array_copy1
integer :: i
real(kind=8), dimension(:), allocatable :: v1
real(kind=8), dimension(:,:,:), allocatable :: m1
allocate ( v1(1:1000) )
allocate ( m1(0:9,5:14,10:19) )
v1(:) = 0
m1(:,:,:) = 1.0
i=9
v1(1:1000) = (/ ( m1(0:9, 5:14, i), i = 10, 19 ) /)
end program array_copy1
[marques@tantalems marques]$ pgf90 -C ./copy.f90
[marques@tantalems marques]$ ./a.out
0: Subscript out of range for array m1 (./copy.f90: 14)
subscript=9, lower bound=10, upper bound=19, dimension=3
The expression is evaluate with initial value of i (ie 9) instead of 10.
cat test1.f90
program t
CHARACTER(len=*) ,PARAMETER :: separator = '("'//REPEAT('-',79)//'")'
character(*),parameter :: simple = "Simple string works"
character(*),parameter :: cat = "Con"//"catena"//"tion"
character(*),parameter :: xxx = repeat('x',3)
character(79) :: rept
character(83) :: sep,sep1
rept = REPEAT('-',79)
sep = '("'//rept//'")'
sep1 = '("'//REPEAT('-',79)//'")'
write (*,*) "REPEAT('-'),79) = ",rept
write (*,*) " sep = ",sep
write (*,*) " sep1 = ",sep1
write (*,*) "len(simple) = ",len(simple)
write (*,*) " simple = ", simple
write (*,*) "len(cat) = ",len(cat)
write (*,*) " cat = ", cat
write (*,*) "len(xxx) = ",len(xxx)
write (*,*) " xxx = ", xxx
write (*,*) "len(separator) = ",len(separator)
write (*,*) " separator = ", separator
write (*,separator)
end
> pgf90 test1.f90
> ./a.out
REPEAT('-'),79) =
-------------------------------------------------------------------------------
sep =
("-------------------------------------------------------------------------------")
sep1 =
("-------------------------------------------------------------------------------")
len(simple) = 19
simple = Simple string works
len(cat) = 13
cat = Concatenation
len(xxx) = 3
xxx = s.
len(separator) = 83
separator =
("nddasind.qasind..acos.acos.dacosdacos.qacos..acosd.acosd.dacosddacos")
nddasind.qasind..acos.acos.dacosdacos.qacos..acosd.acosd.dacosddacos
----------------------------------------------
The use of REPEAT as part of the initialization expression for a
character named constant appears to cause wrong results. This is a
regression in the 6.0 compiler - the 5.2-4 compiler generated correct
code.
>cat test.f
module data
integer,parameter :: ink=4, rlk=8
integer(ink) :: mnod, nnod
integer(ink),pointer :: nodtyp(:), nodnod2(:,:)
real(rlk),pointer :: udot(:),vdot(:),udot_tmp(:),vdot_tmp(:)
end module data
!--------------------
program test
use data
implicit none
integer(kind=ink) :: i, j, iel, icon, nerr
real(kind=rlk) :: smod
! set dimensions
mnod = 10
nnod = mnod
! allocate arrays
allocate(nodtyp(0:mnod),nodnod2(4,0:mnod))
allocate(udot(0:mnod),vdot(0:mnod))
allocate(udot_tmp(0:mnod),vdot_tmp(0:mnod))
! initialise data
do i=0,mnod
nodtyp(i)=i-5
enddo
nodnod2=0
udot=1.0
vdot=2.0
call sub1_ok ! Generate and print correct results
write(*,*) 'Testing sub1'
write(*,201) 'nodtyp',nodtyp
write(*,*) 'Correct results using workaround'
write(*,200) 'udot ',udot
write(*,200) 'vdot ',vdot
201 format(a,11i6)
200 format(a,11f6.3)
! save correct results and reinitialise data
udot_tmp = udot
vdot_tmp = vdot
udot=1.0
vdot=2.0
! Test sub1
call sub1
write(*,*) 'Test results:'
write(*,200) 'udot ',udot
write(*,200) 'vdot ',vdot
! Check for errors and print count Success/Fail message
nerr=0
do i=0,mnod
if (udot(i).ne.udot_tmp(i)) nerr=nerr+1
if (vdot(i).ne.vdot_tmp(i)) nerr=nerr+1
enddo
write(*,*)
if (nerr.gt.0) then
write(*,*) '** Failed **, nerr =',nerr
else
write(*,*) ' Correct!'
endif
write(*,*)
end
!----------------------
subroutine sub1()
use data
implicit none
integer(kind=ink) :: i, n1, n2, n3, n4
do i=1,nnod
udot(i)= merge(0.0_rlk,udot(i),
& nodtyp(i).eq.-1.or.nodtyp(i).eq.-3)
vdot(i)= merge(0.0_rlk,vdot(i),
& nodtyp(i).eq.-2.or.nodtyp(i).eq.-3)
enddo
return
end
!-------------------------
subroutine sub1_ok()
use data
implicit none
integer(ink) :: i, n1, n2, n3, n4
do i=1,nnod
if (nodtyp(i).eq.-1.or.nodtyp(i).eq.-3) udot(i)=0.0_rlk
if (nodtyp(i).eq.-2.or.nodtyp(i).eq.-3) vdot(i)=0.0_rlk
enddo
return
end
> pgf90 test.f
> ./a.out
Testing sub1
nodtyp -5 -4 -3 -2 -1 0 1 2 3 4 5
Correct results using workaround
udot 1.000 1.000 0.000 1.000 0.000 1.000 1.000 1.000 1.000 1.000 1.000
vdot 2.000 2.000 0.000 0.000 2.000 2.000 2.000 2.000 2.000 2.000 2.000
Test results:
udot 1.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
vdot 2.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
** Failed **, nerr = 16
While internal procedures should not be included in the dwarf2
pubnames list, module-contained subprograms probably should be
There is a 2d 5 by 200000 array which is being data initialized in an order which
is not sequential with respect to the column-major order of fortran arrays:
DATA (nip(1,kk), kk=1,200000)/200000*0/
DATA (nip(2,kk), kk=1,200000)/200000*0/
DATA (nip(3,kk), kk=1,200000)/200000*0/
DATA (nip(4,kk), kk=1,200000)/200000*0/
DATA (nip(5,kk), kk=1,200000)/200000*0
Each data statement is initializing a column of the array 5 elements apart.
Either initialize the array with a single statement,
DATA nip/1000000*0/
or just omit the data statements since the array is in a common block.
cat test.f
program test
integer(8) :: is
real,allocatable :: a(:)
allocate(a(8),stat=is)
print *, "size(a) = ",size(a), "; 8 was expected"
print *, "stat = ",is, "; 0 was expected"
end
> pgf90 test.f
> ./a.out
size(a) = 8 ; 8 was expected
stat = 545460846592 ; 0 was expected
pgf90 -Mextend -c x1.for -V
pgf90 6.0-5 64-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGF90/any Linux/x86-64 6.0-5
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
Lowering Error: bad ast optype in expression [ast=85,asttype=12,datatype=0]
Lowering Error: bad ast optype in expression [ast=85,asttype=12,datatype=0]
PGF90-F-0000-Internal compiler error. Errors in Lowering 2 (x1.for: 204)
PGF90/any Linux/x86-64 6.0-5: compilation aborted
The following code causes pgcpp2 to segfault when compiled
"pgCC test.cpp -Mipa=fast -g -o blah".
#include
using namespace std;
int main()
{
cout << "Blah" << endl;
return 0;
}
% cat bug2.f90
module m_wxml_core
implicit none
private
type, public :: xmlf_t
integer :: lun
end type xmlf_t
end module m_wxml_core
module flib_wxml
use m_wxml_core
public
end module flib_wxml
MODULE flib_wstml
use flib_wxml, only: xmlf_t
implicit none
integer, public :: stmAddScalar
private
end module flib_wstml
module flib_wcml
! use flib_wstml, only: stmAddScalar <-------uncomment and it fails
use flib_wstml <-------comment out to fail
PRIVATE
end module flib_wcml
Module siesta_cml
Use flib_wxml
Use flib_wcml
Implicit None
Public
Type(xmlf_t) :: mainXML
End Module siesta_cml
pgf90 -c bug2.f90
compiles successfully. If you uncomment the line and comment the
next line, it will fail as follows, though it passes on Intel compilers.
% pgf90 -V bug2.f90 -c
PGF90-S-0155-Derived type has not been declared - xmlf_t (bug2.f90: 31)
0 inform, 0 warnings, 1 severes, 0 fatal for siesta_cml
C & Fortran interoperability for fortran arrays only works if
the arrays are f77-style, i.e., not assumed shape. For an assumed-shape
array, a descriptor must be present
% pgf90 -c polar_init.f -V
pgf90 6.0-4 32-bit target on x86 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGF90/any Linux/x86 6.0-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGF90-F-0000-Internal compiler error. mk_mem_ptr_shape: extnt not subs 3875 (polar_init.f: 1784)
PGF90/any Linux/x86 6.0-4: compilation aborted
cat test.f90
Module Source_List_Utils
Implicit NONE
SAVE
Integer, Parameter :: max_line = 120 ! max length for each line
Integer :: number_of_records
TYPE Source_List ! define linked list for each source record
Character(LEN=MAX_LINE) :: card
Type(Source_List), Pointer :: next_line
End Type Source_List
TYPE List_ptr ! Define a pointer of type list
TYPE(Source_List), POINTER :: ptr
End Type List_ptr
TYPE(Source_List), POINTER :: current_list
TYPE(List_ptr), ALLOCATABLE :: Card_ptr(:)
CONTAINS
Subroutine Free_Source_List
Integer :: rec_num
TYPE(Source_List), POINTER :: current_list_entry
TYPE(Source_List), POINTER :: temp
current_list_entry => current_list
Do rec_num=1,number_of_records
temp=>current_list_entry%next_line
DEALLOCATE(current_list_entry)
current_list_entry=>temp
card_ptr(rec_num)%ptr=>NULL()
ENDDO
current_list_entry=>NULL()
temp=>NULL()
End Subroutine Free_Source_List
End Module Source_List_Utils
program test
use source_list_utils
number_of_records = 0
call free_source_list
end program test
> pgf90 test.f90
/tmp/pgf90caaaaquEaw.o: In function `source_list_utils_free_source_list_':
/tmp/pgf90caaaaquEaw.o(.text+0xbb): undefined reference to `.BSS2'
% more x.f
program pgf90_bug
implicit none
character(32) :: str
8 format(3(a))
9 format(47('*'))
write(*,9)
str = ' pgf90 compiler bug'
write(*,8) '## as is: ->',str,'<-'
write(*,8) '## debank: ->',deblank(str),'<-'
write(*,9)
stop
contains
function deblank(str_in) result(str_out)
implicit none
character(*), intent(in) :: str_in
character(len_trim(adjustl(str_in))) :: str_out
str_out=trim(adjustl(str_in))
return
end function deblank
end program pgf90_bug
% pgf90 -c x.f -V
pgf90 6.0-4 32-bit target on x86 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGF90/any Linux/x86 6.0-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGF90-F-0000-Internal compiler error. interf:new_symbol, symbol not found 539 (x.f: 19)
PGF90/any Linux/x86 6.0-4: compilation aborted
% pgf90 -o test test.f90 -V
% ./test
memop_ct = 10
got one!
got one!
got one!
got one!
0: DEALLOCATE: memory at 0x57f010 not allocated
% pgf90 -o test test.f90 -V -Mchkstk
% ./test
memop_ct = 10
memop_ct = 1000
memop_ct = 2000
memop_ct = 3000
memop_ct = 4000
memop_ct = 5000
... and so on.
cat test.f90
SUBROUTINE Ops_GroundGPS
IMPLICIT NONE
CHARACTER(LEN=*), PARAMETER :: SubrName = 'Ops_GroundGPS'
CHARACTER(LEN=*), PARAMETER :: ZCodeErr(1) = 'Ops_GroundGPS'
END SUBROUTINE Ops_GroundGPS
> pgf90 -c test.f90
PGF90-S-0000-Internal compiler error. size_of: attempt to get size of assumed size
character 0 (test.f90: 4)
PGF90-W-0000-Internal compiler error. constant string length expected 28
(test.f90: 4)
0 inform, 1 warnings, 1 severes, 0 fatal for ops_groundgps
cat test.f90
subroutine Ops_Thinning
integer,allocatable :: ix(:)
real,pointer :: x(:)
integer :: nlat = 18
allocate(x(1000))
x = 1.
allocate(ix(1000))
x = (x + 90.0) * nlat/180.
ix = min(floor(x),nlat-1)
end subroutine Ops_Thinning
> pgf90 -c test.f90
PGF90-W-0000-Internal compiler error. ref_intrin: result has shape, but dtype is
not array 6 (test.f90: 10)
0 inform, 1 warnings, 0 severes, 0 fatal for ops_thinning
% more test.c
/*===================================================================*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define MAX 10000
typedef struct {
int max;
int *type;
int *ndflg;
} MESH_t;
void set_meaningless( MESH_t *mesh, unsigned short int *eflg );
void main()
{
MESH_t *mesh;
unsigned short int *eflg;
mesh = (MESH_t *) calloc( 1, sizeof( MESH_t ) );
mesh->max = MAX;
mesh->type = (int *) calloc( MAX, sizeof( int ) );
mesh->ndflg = (int *) calloc( MAX, sizeof( int ) );
eflg = (unsigned short int *)
calloc( MAX, sizeof( unsigned short int ) );
set_meaningless( mesh, eflg );
}
void set_meaningless( MESH_t *mesh, unsigned short int *eflg )
{
int ind,indmx;
int iii;
int *ndflg = mesh->ndflg;
int *type = mesh->type;
for(iii=0; iiimax; iii++) {
if ( type[iii] != 99 ) continue;
indmx = (type[iii])/10;
for(ind=0; indmax; iii++) {
if ( (eflg[iii] & (1<<2) ) ) continue;
indmx = (type[iii])/10;
for(ind=0; ind
% pgf90 -c *.f95 -I./include
ErrorMessages.f95:
numericUtilities.f95:
scatteringPhaseFunctions.f95:
pgf90-Fatal-/usr/pgi/linux86-64/6.0/bin/pgf902 TERMINATED by signal 11
Arguments to /usr/pgi/linux86-64/6.0/bin/pgf902
/usr/pgi/linux86-64/6.0/bin/pgf902 /tmp/pgf90eaaaawkFao.ilm -fn scatteringPhaseFunctions.f95
% more error.f90
Module Constants
Integer, Parameter, private :: S = Selected_real_kind(6,15)
Integer, Parameter, private :: D = Selected_real_kind(14,99)
Integer, Parameter, private :: Q = Max(Selected_real_kind(25,400), D)
Integer, Parameter :: Precision = D, Single=S
End Module Constants
% pgf90 -c error.f90 -V
pgf90 6.0-5 64-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
PGF90-S-0155-Intrinsic not supported in intialization: max (error.f90: 5)
0 inform, 0 warnings, 1 severes, 0 fatal for constants
but on 5.2 it compiles without incidet.