PGI Support


Technical Problem Report 3575


$ cat testcase.f90
function escape_char_array(s_a) result(s_out)
character, dimension(5) :: s_a
character(count(s_a=="'")) :: s_out

s_out = ''

end function escape_char_array
$ pgf90 -c testcase.f90
Lowering Error: unknown intrinsic function [ast=16,asttype=14,datatype=6]
PGF90-F-0000-Internal compiler error. Errors in Lowering 1 (testcase.f90: 7)
PGF90/any Linux/x86 6.0-4: compilation aborted

Technical Problem Report 3714


Failures in NAG95 tests TOP95/e19 and HANDBOOK/f45. NAG tests are a suite of F95 tests produced by NAG.


Technical Problem Report 3720


PGI seems to be missing some floating point math routines in windows. This has been corrected in the new native mode Win32 6.2 release.

#include 
#include 

int main(void)
{
float y,x = 0.0;
y = tanf(x);
return EXIT_SUCCESS;
}

bash-3.00$ pgcc -v test.c
PGC/x86 nt86 6.0-8: compilation successful
c:DOCUME~1CHULBE~1.MAXLOCALS~1Temp/pgccb03264.o(.text+0x2f):test.c:
undefined reference to `tanf'

c:PROGRA~1PGI/nt86/6.0/bin/pgc.EXE test.c -opt 1 -x 19 0x400000 -x 119
0x40610400 -x 119 0x100000 -x 119 0x1000 -x 120 0x80 -x 122 0x40 -x 123
0x1000 -x 127 4 -x 80 0x300 -y 80 0x1000 -x 80 0x40000000 -x 119
0x1000000 -astype 1 -stdinc
c:PROGRA~1PGI/nt86/6.0/include;c:PROGRA~1PGI/nt86/6.0/mingw/include;c:
PROGRA~1PGI/nt86/6.0/mingw/mingw32/include;c:PROGRA~1PGI/nt86/6.0/mingw/lib/gcc-lib/mingw32/2.95.3-5/include

-def POSIX -def __POSIX -def __POSIX__ -def WIN32 -def _WIN32 -def
__WIN32 -def __WIN32__ -def WINNT -def __WINNT -def __WINNT__ -def
_X86_=1 -def __MINGW32__=1.0 -def __MSVCRT__ -def __i386 -def __i386__
-def i386 -def nt86 -def unix -predicate '#machine(i386) #lint(off)
#system(unix) #system(winnt) #cpu(i386)' -cmdline '+pgcc test.c -v' -asm
c:DOCUME~1CHULBE~1.MAXLOCALS~1Temp/pgcca03264.s

c:PROGRA~1PGI/nt86/6.0/bin/as.EXE
c:DOCUME~1CHULBE~1.MAXLOCALS~1Temp/pgcca03264.s -o
c:DOCUME~1CHULBE~1.MAXLOCALS~1Temp/pgccb03264.o

c:PROGRA~1PGI/nt86/6.0/bin/ld.EXE
c:PROGRA~1PGI/nt86/6.0/mingw/lib/crt2.o
c:PROGRA~1PGI/nt86/6.0/lib/pgstdinit-msv.o
c:PROGRA~1PGI/nt86/6.0/lib/pgimainxx.o
c:DOCUME~1CHULBE~1.MAXLOCALS~1Temp/pgccb03264.o
-Lc:PROGRA~1PGI/nt86/6.0/mingw/lib
-Lc:PROGRA~1PGI/nt86/6.0/mingw/mingw32/lib
-Lc:PROGRA~1PGI/nt86/6.0/mingw/lib/gcc-lib/mingw32/2.95.3-5
-Lc:PROGRA~1PGI/nt86/6.0/lib -lpgc -lmingw32 -lgcc -lmoldname -lmsvcrt
-luser32 -lkernel32 -ladvapi32 -lshell32
pgcc-Fatal-linker completed with exit code 1

Technical Problem Report 3719


Ascii Text in Windows would not be processed properly unless you perform a dos2unix filename 6.2-5 release fixes this.


Technical Problem Report 3722


Code compiles properly now with pgcc when -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE is added to the compile line.

#include 
#include 
#include 

-------------------------------------------------
int main(int argc, char **argv)
{
struct stat64 buf;
if (stat64(argv[1], &buf)>=0) {
printf("%dn", (int)(buf.st_size/1024L));
} else
printf("errorn");
}



Technical Problem Report 3724


Webpage instructions refer to old '$PGI/linux86/bin/pghostid' path are changed to '$PGI/linux86/bin/6.x/pghostid' path


Technical Problem Report 3743


Here is a short Fortran 90 program that shows a compiler problem:

subroutine stats_data(bd)
implicit none
integer, parameter :: MAX_SOUND=100000
integer, parameter :: MAX_CHANNEL=15
integer :: i
integer :: isound=1
real, dimension(MAX_CHANNEL) :: bd
real, dimension(MAX_CHANNEL,MAX_SOUND) :: tovs_bt_dev=0.0

! Compiling with the next line takes 1000 times longer than
! compiling with the line after next instead!
integer :: ncount(MAX_SOUND)= (/(0,i=1,MAX_SOUND)/)
! integer :: ncount(MAX_SOUND)=0

tovs_bt_dev(:,isound)=bd(:)
end subroutine stats_data

Initializing the ncount array with the data statement style, compile time is 290 seconds; initializing with the othre style, compile time is 0.27 seconds. The compile command was:

pgf90 -c stats_data.o -g stats_data.f90

Compiler version is: pgf90 6.1-1 64-bit target on x86-64 Linux

Resulting object files are almost the same size, and are very large, scaling linearly with MAX_SOUND. The compile time with the slow method, however, is quadratic in MAX_SOUND.

Technical Problem Report 3746


pgCC fails to extract or inline functions by name (either mangled or unmangled):

$ cat test.sh
#!/bin/sh
#
# Demonstrate the ability to inline by name in C,
# and the inability in C++
#
cat <test1.c
void test1 () {
void test2 ();
test2 ();
}
EOF
#
cat <test2.c
void test2 () {}
EOF
#
echo Extract and inline using pgcc works
#
rm -rf inline_lib
pgcc -c -Minfo=inline -Mextract=name:test2,lib:inline_lib test2.c
ls -l inline_lib
cat inline_lib/TOC
pgcc -c -Minfo=inline -Minline=name:test2,lib:inline_lib test1.c
#
cat <test1.C
void test2 () {}
void test1 () {
void test2 ();
test2 ();
}
EOF
#
cat <test2.C
void test2 () {}
EOF
#
echo Extract and inline using pgCC fails
#
rm -rf inline_lib
pgCC -c -Minfo=inline -Mextract=name:test2,lib:inline_lib test2.C
ls -l inline_lib
pgCC -c -Minfo=inline -Mextract=name:test2__Fv,lib:inline_lib test2.C
ls -l inline_lib
#
rm -rf inline_lib
rm -rf test[12].[Cco]
#
# All done
#
$ ./test.sh
Extract and inline using pgcc works
test2:
1, extracting function test2, size 1
total 8
-rwxr-xr-x 1 geir compiler 39 Feb 14 17:36 TOC
-rw-r--r-- 1 geir compiler 117 Feb 14 17:36 i00.e
test1:
3, function test2 inlined, size 1
Extract and inline using pgCC fails
total 0
-rwxr-xr-x 1 geir compiler 0 Feb 14 17:36 TOC
total 0
-rwxr-xr-x 1 geir compiler 0 Feb 14 17:36 TOC


Technical Problem Report 3764


By default, we'd like pgcc to support "//" style comments for C89. This style is the default for C99 (or at least it should be, as defined by the language specification).


Technical Problem Report 3765


Changing default pgcc to -C99. Added switch to support -C89.


Technical Problem Report 3769


If you compile with the flag -Mpfo without having the pgfi.out file in the proper directory, the compiler generates an ICE message (although it seems to continue to compile).


Technical Problem Report 3775


The installation should create a universally writeable flexlm.log file in $PGI. This file then is accessible to every user of the compilers, without any errors flexlm.log cannot log.


Technical Problem Report 3776


module pgi_bug_20060317a

contains

function err_str (errno)
integer, intent(in) :: errno
character(len=len_trim(error_string(errno))) ::err_str
err_str = trim(error_string(errno))
end function err_str

pure function error_string (errno)
integer, intent(in) :: errno
character(len=64) :: error_string
select case (errno)
case (1)
error_string = 'some string ...'
case default
error_string = 'another string ...'
end select
end function error_string

end module pgi_bug_20060317a



% pgf90 -c *.f90
PGF90-S-0074-Illegal number or type of arguments to len_trim - keyword argument string (pgi_bug_20060317a.f90: 7)
0 inform, 0 warnings, 1 severes, 0 fatal for err_str
0 inform, 0 warnings, 1 severes, 0 fatal for error_string
PGF90/any Linux/x86 6.1-3: compilation completed with severe errors
% pgf90 -c *.f90 -tp k8-64
PGF90-S-0074-Illegal number or type of arguments to len_trim - keyword argument string (pgi_bug_20060317a.f90: 7)
0 inform, 0 warnings, 1 severes, 0 fatal for err_str
0 inform, 0 warnings, 1 severes, 0 fatal for error_string
PGF90/any Linux/x86-64 6.1-3: compilation completed with severe errors


Technical Problem Report 3779


Argument checking for calls to module procedures (or other instances where the interface is explicit) should be done more completely.


Technical Problem Report 3781


PGI compilers generate temporary files of the form /tmp/pgCCaaaaaFerab.il (when inlining, for example), but the name is not sufficiently unique to avoid conflicts when multiple users are compiling, or when a single user is running parallel make.


Technical Problem Report 3782


PGI compilers generate temporary files of the form /tmp/pgCCaaaaaFerab.il (when inlining, for example), but the name is not sufficiently unique to avoid conflicts when multiple users are compiling, or when a single user is running parallel make. Also, not all of the temp files are cleaned up on completion.


Technical Problem Report 3786


Problem in pgCC driver was linking non-fpic libs with code when -mcmodel=medium used. This is corrected.

pgCC -mcmodel=medium -V test.cpp
pgCC 6.1-3 64-bit target on x86-64 Linux
Edison Design Group C/C++ Front End, version 3.6 (Dec 1 2005 15:04:32)

/usr/lib64/gcc/x86_64-suse-linux/4.0.2//crtbegin.o: In function
`__do_global_dtors_aux':
crtstuff.c:(.text+0x2): relocation truncated to fit: R_X86_64_PC32 against `.bss'
crtstuff.c:(.text+0x2e): relocation truncated to fit: R_X86_64_PC32 against `.bss'
/usr/bin/ld: final link failed: Invalid argument

Technical Problem Report 3788


Technically, Array constructor values of type character must all have the same length. But we now accept this variation.

% more test.f
PROGRAM Test
ierror=0
statarray=0
! return
end

function Merge_Files()
character files(1:8)
character filetemp*10
integer n,ios
integer(8) nbytes
! byte b,bv(1024)
real b,bv(1024)
integer(4) istat
files(1:8) = (/'','a','b','c','d','e','f','g'/)
Merge_Files=1
open(1000,file='xxx.bin',err=911,form='BINARY')
goto 912
911 Merge_Files=0
912 close(1000)
close(1001)
return
end


% pgf90 -c test.f -V

pgf90 6.1-3 32-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGF90/any Linux/x86 6.1-3
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGF90/x86 Linux/x86 6.1-3
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGF90-S-0000-Internal compiler error. assem.c-put_skip old,new not in sync 0 (test.f: 33)
0 inform, 0 warnings, 1 severes, 0 fatal for merge_files


Technical Problem Report 3791


Added the version query macros __PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__


Technical Problem Report 3799


Customer expects a unique scratch file for each node running.

> cat test.f
program test
parameter (n=10000000)
double precision a(n)
character*32 myfile

include 'mpif.h'

call MPI_Init (ierr)
call MPI_Comm_rank (MPI_COMM_WORLD, me, ierr)
open (unit=10, status='scratch', form='unformatted')

a = me
do i = 1, 3
print *, 'rank ', me, ' writing record ',i
write (10) a
call sleep (3)
end do

rewind (10)
read (10) a
do i = 1, n
if (a(i) .ne. me) then
print *, 'rank ', me, ' read error at element ', i
exit
end if
end do

close (10, status='delete')
call MPI_Finalize (ierr)
end

Executing the program, compiled with default options:

> mpirun -np 2 ./a.out
rank 1 writing record 1
rank 0 writing record 1
rank 1 writing record 2
rank 0 writing record 2
rank 1 writing record 3
rank 0 writing record 3
rank 1 read error at element 1

Technical Problem Report 3803




Technical Problem Report 3809


User code causes C++ runtime abort.

(ffe-64 107%) make
pgCC -fPIC -Xa -A --no_using_std --diag_suppress 940 -g -O0 -Kieee --
no_implicit_include -Mdaz --diag_suppress 450 -c x.cc
pgCC -fPIC -Xa -A --no_using_std --diag_suppress 940 -g -O0 -Kieee --
no_implicit_include -Mdaz --diag_suppress 450 -c Name_Vec.t.cc
pgCC -shared -o libA.so Name_Vec.t.o
pgCC -fPIC -Xa -A --no_using_std --diag_suppress 940 -g -O0 -Kieee --
no_implicit_include -Mdaz --diag_suppress 450 -c Tester.cc
pgCC -shared -o libB.so Tester.o
pgCC -R. -o x x.o -L. -lB -lA
(ffe-64 108%) ./x
C++ runtime abort: internal error: static object marked for
destruction more than once
Abort


Technical Problem Report 3812


the progrma below compiled fine with 6.0 compilers, but in 6.1 it generates an error.

PROGRAM essai
IMPLICIT NONE

INTEGER PNB_EPHNUM_QUALITE
PARAMETER (PNB_EPHNUM_QUALITE = 100)
DOUBLE PRECISION PXPASEPHNUM
PARAMETER (PXPASEPHNUM = EPSILON(1.d0))
DOUBLE PRECISION PXPASQEPHFINES
PARAMETER (PXPASQEPHFINES= dble(PNB_EPHNUM_QUALITE) * PXPASEPHNUM) <----- here's the bug

WRITE(*,*) "Hello World"


WRITE (*,*) PXPASQEPHFINES, EPSILON(1.d0)*DBLE(PNB_EPHNUM_QUALITE), PXPASQEPHFINES - EPSILON(1.d0)*DBLE(PNB_EPHNUM_QUALITE)


END PROGRAM essai

With version 6.1-2t :
PGF90-S-0091-Constant expression of wrong data type (essai.F90: 9)
PGF90-S-0091-Constant expression of wrong data type (essai.F90: 9)
0 inform, 0 warnings, 2 severes, 0 fatal for essai

Technical Problem Report 3813


User program was failing with pgCC, not g++.

% pgCC -c myTest.cpp -v -tp k8-64

/tmp/pgi614/linux86-64/6.1/bin/pgcpp1 --llalign -Dunix -D__unix -D__unix__ -Dlinux -D__linux -D__linux__ -D__inline__= -D__NO_INLINE__ -D__NO_MATH_INLINES -D__x86_64__ -D__LONG_MAX__=9223372036854775807L '-D__SIZE_TYPE__=unsigned long int' '-D__PTRDIFF_TYPE__=long int' -D__THROW= -D__amd64__ -D__PGI -I/tmp/pgi614/linux86-64/6.1/include/CC -I/tmp/pgi614/linux86-64/6.1/include -I/usr/local/include -I/usr/lib/gcc/x86_64-redhat-linux/4.1.0/include -I/usr/lib/gcc/x86_64-redhat-linux/4.1.0//include -I/usr/include -q -o /tmp/pgCCaaaaaEdDad.il myTest.cpp
"myTest.cpp", line 4: warning: return type of function "main" must be "int"
void main() {
^

"myTest.cpp", line 6: error: unknown register name "rsi"
PREFETCHNTA(testchar);
^

1 error detected in the compilation of "myTest.cpp".
pgCC-Fatal-cpp1 completed with exit code 2

Technical Problem Report 3814


User code produced false error.

pgf90 -c test.f90 -o test.o
PGF90-S-0155-routine is use-associated from modules mod1 and mod0, and cannot be accessed (test.f90: 7)
0 inform, 0 warnings, 1 severes, 0 fatal for test

Technical Problem Report 3815


User code causes the compiler to break.

The following compiles with sun f90 and with gfortran.

% pgf90 -c test1.f90
pgf90-Fatal-/tmp/pgi614/linux86/6.1/bin/newcg/pgf901 TERMINATED by signal 11
Arguments to /tmp/pgi614/linux86/6.1/bin/newcg/pgf901
/tmp/pgi614/linux86/6.1/bin/newcg/pgf901 test1.f90 -opt 1 -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 /tmp/pgi614/linux86/6.1/include:/usr/local/include:/usr/lib/gcc/i586-suse-linux/4.0.2/include:/usr/lib/gcc/i586-suse-linux/4.0.2//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= -freeform -vect 48 -output /tmp/pgf90aaaaawDjas.ilm

Technical Problem Report 3817


Data initialization causes too much verbage to be written to the asm intermediate file. The file should be minimal in this case.

program hang_compile
implicit none
integer(kind=8) ::i
integer(kind=8), parameter :: n=1000000
integer(kind=8), dimension(n) :: iarr

real(kind=8), dimension(n) :: rarr=(/(i*1.0,i=1,n) /), a

end program hang_compile

Technical Problem Report 3819


% more test1.f90
subroutine sub (x,y)
real x,y,a
namelist /l/ a,x

x = y
entry sub1(x)

x = x + 1
end

Fails on 32 and 64-bit 6.1-4 and 6.1-5
% pgf90 -c -V test1.f90
pgf90 6.1-4 32-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGF90/any Linux/x86 6.1-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGF90/x86 Linux/x86 6.1-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
%
% pgf90 -c -V test1.f90 -g -tp k8-64

pgf90 6.1-4 64-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGF90/any Linux/x86-64 6.1-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGF90/x86 Linux/x86-64 6.1-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
/tmp/pgf90baaaapvoaB.s: Assembler messages:
/tmp/pgf90baaaapvoaB.s:173: Error: symbol `..D1' is already defined
harrier%

Technical Problem Report 3821


User program seg faults on execution.

% pgf90 -c -g main.F
PGF90-F-0004-Corrupt or Old Module file ./junmod.mod (./fast.H: 7)
PGF90/any Linux/x86 6.1-5: compilation aborted
% pgf90 -c -g junmod.F
PGF90-W-0155-Mismatched data type for member jcnx1 (junmod.F: 457)
PGF90-W-0155-Mismatched data type for member jcnx2 (junmod.F: 457)
PGF90-W-0155-Mismatched data type for member jcnx3 (junmod.F: 457)
PGF90-W-0155-Mismatched data type for member jcnxd (junmod.F: 457)
PGF90-W-0155-Mismatched data type for member junftl (junmod.F: 457)
PGF90-W-0155-Mismatched data type for member arat (junmod.F: 457)
PGF90-W-0155-Mismatched data type for member jfacep (junmod.F: 457)
PGF90-W-0155-Mismatched data type for member qualnj (junmod.F: 457)
0 inform, 8 warnings, 0 severes, 0 fatal for fatojct
% pgf90 -c -g main.F
% pgf90 -o r.x main.o junmod.o
% ./r.x
Segmentation fault

Technical Problem Report 3822


Code below compiles on other compilers, and fails on pgf90.

% more bug2.f90
module MODA
implicit none
private
public :: nrrq,nrfnsh
integer, parameter :: mi=16,mr=16
integer :: i(mi)
real :: r(mr)
integer :: nrrq,nrfnsh
equivalence (i(1),nrrq)
equivalence (i(2),nrfnsh)
end module

program PROG1
use MODA , only : nrrq, nrfnsh
implicit none
nrrq = 0
nrfnsh = 0
write(*,*) nrrq, nrfnsh
end program PROG1
% pgf90 -o bug2 bug2.f90 -V

pgf90 6.1-5 32-bit target on x86 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGF90/any Linux/x86 6.1-5
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGF90-S-0059-Conflicting equivalence between i and nrfnsh (bug2.f90: 3)
PGF90-S-0059-Conflicting equivalence between i and nrrq (bug2.f90: 1)
0 inform, 0 warnings, 2 severes, 0 fatal for moda

Technical Problem Report 3825


%more tom.c

#include 
#include 

int my_printf (const char *format, ...);
int my_printf (const char *format, ...)
{
va_list ap;

va_start (ap, format);
vfprintf (stdout, format, ap);
va_end (ap);

return 0;
}

int main (void)
{
double d1 = 0;
my_printf ("Hello World, this is %gn", d1);
return 0;

% pgcc -tp k8-32 -o tom_32_pgcc tom.c -V

pgcc 6.1-5a 32-bit target on x86 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGC/x86 Linux/x86 6.1-5a
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.

% pgcc -tp k8-64 -o tom_64_pgcc tom.c -V

pgcc 6.1-5a 64-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGC/x86-64 Linux/x86-64 6.1-5a
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.

% gcc -o tom_64_gcc tom.c --version
gcc (GCC) 4.1.0 20060304 (Red Hat 4.1.0-3)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

% gcc -o tom_32_gcc tom.c --version
gcc (GCC) 4.1.0 20060304 (Red Hat 4.1.0-3)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

% ./tom_gcc_64_fc5
Hello World, this is 0
% ./tom_32_gcc
Hello World, this is 0
% ./tom_64_pgcc
Hello World, this is 2.122e-314 <----bad.
% ./tom_32_pgcc
Illegal instruction <--------------this happened on 
% ./tom_32_pgcc
Hello World, this is 0

% pgcc -tp k8-32 -V -o tom_32_pgcc_emblem tom.c

pgcc 6.1-5a 32-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGC/x86 Linux/x86 6.1-5a
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
% ./tom_32_pgcc_emblem
Hello World, this is 0
% ./tom_32_pgcc_emblem
Illegal instruction

Technical Problem Report 3829


Technical report about the ineffective use of !pgi$ prefetch. The actual syntax of the sentinel in this case is different, and should be corrected in the User Guide.

!$mem

For fixed form, it's


c$mem

Technical Problem Report 3830


% pgCC -c -I. ot.c -V

pgCC 6.1-5 32-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
Edison Design Group C/C++ Front End, version 3.6 (Dec 1 2005 15:02:48)
Copyright 1988-2005 Edison Design Group, Inc.

PGCC/x86 Linux/x86 6.1-5
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
% pgCC -c -I. ot.c -V -g

pgCC 6.1-5 32-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
Edison Design Group C/C++ Front End, version 3.6 (Dec 1 2005 15:02:48)
Copyright 1988-2005 Edison Design Group, Inc.

PGCC/x86 Linux/x86 6.1-5
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
/tmp/pgCCvyy-k2aMEsY.s: Assembler messages:
/tmp/pgCCvyy-k2aMEsY.s:93927: Error: can't resolve `.text' {.text section} - `.LB6733' {.gnu.linkonce.t.__CPR121____as__Q2_3std43vector__tm__29_dQ2_3std18allocator__tm__2_dFRCQ2_3std20vector__tm__7_Z1ZZ2Z_RQ2_3stdJ68J section}
% pgCC -c -I. ot.c -V -g -tp k8-64

pgCC 6.1-5 64-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
Edison Design Group C/C++ Front End, version 3.6 (Dec 1 2005 15:04:32)
Copyright 1988-2005 Edison Design Group, Inc.

PGCC/x86 Linux/x86-64 6.1-5
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
/tmp/pgCCdKyj7a3X3Bx.s: Assembler messages:
/tmp/pgCCdKyj7a3X3Bx.s:83541: Error: can't resolve `.text' {.text section} - `.LB6794' {.gnu.linkonce.t.__CPR121____as__Q2_3std43vector__tm__29_dQ2_3std18allocator__tm__2_dFRCQ2_3std20vector__tm__7_Z1ZZ2Z_RQ2_3stdJ68J section}

Technical Problem Report 3831


A user encountered a limit in preprocessor where macro arguments can only be up to 8192 characters long. GCC allows any length. We have made the limit larger, and will strive to make it any length in the future.



Technical Problem Report 3832


pgcc -DHAVE_CONFIG_H -I. -I.. -I./include -I./libadd -DUNIX -D__USE_FIXE_PROTOTYPES -O -c init.c
PGC-S-0204-Actual parameters too long for DO_STANDARD_COMMAND_LINE (init.c: 237)
PGC-S-0204-Actual parameters too long for DO_STANDARD_COMMAND_LINE (init.c: 237)
PGC-S-0204-Actual parameters too long for DO_STANDARD_COMMAND_LINE (init.c: 237)
PGC-S-0204-Actual parameters too long for DO_STANDARD_COMMAND_LINE (init.c: 237) 
.....

Technical Problem Report 3833


User wants compiler version put into object code.

% pgcc -c hello.c -V

pgcc 6.2-2 32-bit target on x86 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
PGC/x86 Linux/x86 6.2-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.

% objdump -s hello.o | grep PG
 0000 00504743 20362e32 2d3200             .PGC 6.2-2.

Technical Problem Report 3835


-Mstabs has been disabled, as its use in Win32 only is no longer needed.

pgf90 -Mstabs -g test.f
pgf90-Fatal-/opt/pgi/6.1.4/linux86-64/6.1/bin/pgf902
TERMINATED by signal 11 Arguments to
/opt/pgi/6.1.4/linux86-64/6.1/bin/pgf902
/opt/pgi/6.1.4/linux86-64/6.1/bin/pgf902
/tmp/pgf90aaaaazwDaw.ilm -fn test.f -debug -x 120 0x200 -opt 0
-terse 1 -inform warn -x 51 0x20 -x 119 0xa10000 -x 122 0x40
-x 123 0x1000 -x 127 4 -x 127 16 -x 19 0x400000 -x 28 0x40000
-quad -x 120 0x80000000 -x 59 4 -x 59 4 -y 80 0x1000 -x 80
0x10800000 -x 124 0x1400 -y 15 2 -x 57 0x3b0000 -x 58
0x48000000 -x 49 0x100 -x 120 0x200 -astype 0 -x 124 1 -x 120
0x30 -cmdline '+pgf90 test.f -Mstabs -g' -asm

Technical Problem Report 3836


Comments within an undefined #ifdef block are preserved. This behavior is contrary to other compilers:


% cat 735169.c
/*
Comment not contained within a #if 0
*/
int global;
#if 0
/*
Comment contained within a #if 0
*/
int global2;
#endif
% pgcc -E -C 735169.c -V

pgcc 6.1-5 32-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGC/x86 Linux/x86 6.1-5
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
# 1 "735169.c"
/*
Comment not contained within a #if 0
*/
int global ;
# 6 "735169.c"
/*
Comment contained within a #if 0
*/



% gcc -E -C 735169.c
# 1 "735169.c"
# 1 ""
# 1 ""
# 1 "735169.c"
/*
Comment not contained within a #if 0
*/
int global;

---------------part 2-------------------------------
Comments that are within a "#if 0" block
are combined in to one line. This could result in a large line that
cannot be processed by editors. It is likely this problem would be
resolve if problem #1 is fixed:

% cat 735169a.c
#if 0
int g0; /* Comment line 1 */
int g1; /* Comment line 2 */
/* Comment line 3 */
/* Comment line 4 */
int g2; /* Comment line 5 */

/* Comment line n - 1 */
int gn /* Comment line n */
#endif
/* Comment 1 not within #if 0 */
/* Comment 2 not within #if 0 */
int i;
% pgcc -E -C 735169a.c
# 1 "735169a.c"
# 2 "735169a.c"
/* Comment line 1 */ /* Comment line 2 */ /* Comment line 3 */ /* Comment line 4 */ /* Comment line 5 */ /* Comment line n - 1 */ /* Comment line n */
# 11 "735169a.c"
/* Comment 1 not within #if 0 */
/* Comment 2 not within #if 0 */
int i ;

% gcc -E -C 735169a.c
# 1 "735169a.c"
# 1 ""
# 1 ""
# 1 "735169a.c"
# 11 "735169a.c"
/* Comment 1 not within #if 0 */
/* Comment 2 not within #if 0 */
int i;

Technical Problem Report 3838


The same error occurs with the NAG F95 Handbook test f87:

pgf90 -c -Mfree -O1 -Vdev /proj/qa/tests/nag_f95/compiler.f90
pgf90 -c -Mfree -O1 -Vdev /proj/qa/tests/nag_f95/chkbk.f90
pgf90 -c -Mfree -O1 -Vdev /proj/qa/tests/nag_f95_handbook/f87.f90
PGF90-S-0034-Syntax error at or near FORALL (/proj/qa/tests/nag_f95_handbook/f87.f90: 817)
PGF90-S-0034-Syntax error at or near identifier int_where (/proj/qa/tests/nag_f95_handbook/f87.f90: 819)
PGF90-S-0034-Syntax error at or near FORALL (/proj/qa/tests/nag_f95_handbook/f87.f90: 831)
PGF90-S-0034-Syntax error at or near FORALL (/proj/qa/tests/nag_f95_handbook/f87.f90: 832)
PGF90-S-0034-Syntax error at or near identifier inner (/proj/qa/tests/nag_f95_handbook/f87.f90: 834)
PGF90-S-0034-Syntax error at or near identifier outer (/proj/qa/tests/nag_f95_handbook/f87.f90: 835)

Technical Problem Report 3841


User code fails.

./compileit

PGC-S-0000-Internal compiler error. flowgraph: node is zero 40 (xxx.c: 4843)
PGC/x86 Linux/x86 6.1-5: compilation completed with severe errors

if you change the compileit script to -tp p7 instead of -tp px, or -tp piii, compilation
will not fail. 

Technical Problem Report 3842


Documentation needs correction.

Page 87 of the User Guide states

Default: For arguments that you do not specify, the default code generation controls are as
follows:
nodaz noflushz
norecursive nostride0
noreentrant
nosecond_underscore
noref_externals
signextend

There may be other problems here, but -Mnosignextend is default

Technical Problem Report 3843


__asm__ was not handled by the compiler well.

> cat bug.c
#include 
uint64_t get_tsc(void) {
uint64_t ret;
__asm__ __volatile__("rdtsc" : "=A" (ret));
return ret;
}
> pgcc -c bug.c
pgcc-Fatal-pgc TERMINATED by signal 11

Technical Problem Report 3844


> cat pgi_bug2.c
#include 

void my_atomic64_set(volatile uint64_t *p, uint64_t val, int flags) {
uint64_t oldval = *p;
uint32_t oldlo = oldval;
uint32_t oldhi = oldval >> 32;
const uint32_t vallo = val;
const uint32_t valhi = val >> 32;
__asm__ __volatile__ (
"0: lock; cmpxchg8b %0 nt"
"jnz 0b "
: "=m" (*p), "+&a" (oldlo), "+&d" (oldhi)
: "b" (vallo), "c" (valhi), "m" (*p)
: "cc" );
}

% pgcc -c pgi_bug2.c -V -tp k8-32

pgcc 6.1-5 32-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGC/x86 Linux/x86 6.1-5
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGC-W-0354-Can't find a register in class 'AREG' for extended ASM operand 1 (pgi_bug2.c: 4)
pgcc-Fatal-/tmp/pgi615/linux86/6.1/bin/newcg/pgc TERMINATED by signal 11

Technical Problem Report 3845


Users who build their code on (for example) Suse systems, with -mp, will fail to execute the program on on systems like RHEL 4, because libnuma.so is missing. We are using libnuma when available, but the executable then has dynamic links to a library not always present. We now have a libpgnuma, that is linked to the real libnuma, or a dummy one we supply.


Technical Problem Report 3847


% cat test1.F90
module mpp_data_mod

type domain1D
type(domain1D), pointer :: list(:) =>NULL()
end type domain1D
type :: atttype
integer :: type, len
end type atttype
type :: axistype
type(domain1D) :: domain
end type axistype
type :: fieldtype
type(axistype), pointer :: axes(:) =>NULL()
end type fieldtype
type :: filetype
type(fieldtype), pointer :: var(:) =>NULL()
type(atttype), pointer :: att(:) =>NULL()
end type filetype
public :: error
integer :: error
type(filetype), allocatable :: mpp_file(:)

end module mpp_data_mod

module mpp_util_mod

use mpp_data_mod, only : error
implicit none
private

#include 

public :: mpp_error

interface mpp_error
module procedure mpp_error_basic
module procedure mpp_error_noargs
end interface

contains

subroutine mpp_error_basic( errortype )
integer, intent(in) :: errortype
if( errortype.EQ.2)then
call MPI_ABORT( MPI_COMM_WORLD, 1, error )
end if
end subroutine mpp_error_basic

subroutine mpp_error_noargs()
call mpp_error(2)
end subroutine mpp_error_noargs

end module mpp_util_mod
% pgf90 -c test1.F90 -Minline -V -tp k8-64

pgf90 6.1-5 64-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGF90/any Linux/x86-64 6.1-5
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGF90/x86 Linux/x86-64 6.1-5
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGF90/any Linux/x86-64 6.1-5
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGF90/x86 Linux/x86-64 6.1-5
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
pgf90-Fatal-/tmp/pgi615/linux86-64/6.1/bin/pgf902 TERMINATED by signal 11

Technical Problem Report 3848


The following simple code will cause the compiler to hang because of a spelling error with the word "module". When compiling, it correctly catches the error, but hangs before exiting.

modle fooModule

contains

integer function setval()
implicit none
real :: r

setval = 5.0

end function

end module

program foobar
use fooModule
implicit none

real :: rval

rval = setval()
write(*,*) 'rval = ', rval

stop
end program

Technical Problem Report 3849


User presented 3 different compiles of code that should produce the same result. They do not.

pgcc -tp k8-64 -o a1.out test.c -fast
pgcc -tp k8-64 -o a2.out test.c -fastsse
pgcc -tp k8-64 -o a3.out test.c -fastsse -Mipa=ptr


a1.out >& a1_output
a2.out >& a2_output
a3.out >& a3_output

no differences between a1_output and a2_output

many differences between a1/a2_output and a3_output


Technical Problem Report 3850


User submitted code that did not speed up as expected with optimizations. This was analyzed and improvements were made to the compiler.



Technical Problem Report 3851


User code caused segmentation fault when executed. This is corrected.



Technical Problem Report 3852


The following code is not thread safe, and should be.

% cat pgi_bug1a.c
#include 
typedef struct { volatile uint32_t ctr; } my_atomic32_t;

int my_atomic32_compare_and_swap_ver2(my_atomic32_t *v, uint32_t oldval,
uint32_t newval) {
volatile uint32_t * const p = &(v->ctr);
register unsigned char retval;
register uint32_t readval;
__asm__ __volatile__ (
"lock; cmpxchgl %3, %1 nt"
"sete %b0"
: "=qm" (retval), "=m" (*p), "=a" (readval)
: "r" (newval), "m" (*p), "a" (oldval)
: "cc" );
return (int)retval;
}

Technical Problem Report 3854


% cat tmp2.f90

INTEGER*4, PARAMETER :: NCAMS = 9
REAL, PARAMETER :: TLINE = 0.0408
INTEGER*4, PARAMETER, DIMENSION(NCAMS) :: DELTATL = &
& (/ 0,1468,2760, &
& 3887,5000,6113, &
& 7240,8532,10000 /)
REAL, DIMENSION(NCAMS) :: DELTAT = DELTATL * TLINE
! DELTAT = REAL(DELTATL)*TLINE
print *, DELTAT
end
pgf90 tmp2.f90
PGF90-S-0091-Constant expression of wrong data type (tmp2.f90: 8)
PGF90-S-0091-Constant expression of wrong data type (tmp2.f90: 8)
PGF90-S-0091-Constant expression of wrong data type (tmp2.f90: 8)
PGF90-S-0091-Constant expression of wrong data type (tmp2.f90: 8)
PGF90-S-0091-Constant expression of wrong data type (tmp2.f90: 8)
PGF90-S-0091-Constant expression of wrong data type (tmp2.f90: 8)
PGF90-S-0091-Constant expression of wrong data type (tmp2.f90: 8)
PGF90-S-0091-Constant expression of wrong data type (tmp2.f90: 8)
PGF90-S-0091-Constant expression of wrong data type (tmp2.f90: 8)
0 inform, 0 warnings, 9 severes, 0 fatal for MAIN

Technical Problem Report 3855


>cat test.f90
PROGRAM HD3D
IMPLICIT NONE
integer :: m
COMPLEX, ALLOCATABLE, DIMENSION (:,:,:) :: c1

write(0,*) 'Array c1 has dimension c1(513,1024,705:768)'
ALLOCATE( c1(513,1024,705:768), stat = m )
write(0,*) 'Array c1 was allocated, stat = ',m

! The next line causes a memory/segmentation fault
c1 = (1.,0.)
write(0,*) 'Initialized c1'

END PROGRAM HD3D

> pgf90 test.f90
> ./a.out
Array c1 has dimension c1(513,1024,705:768)
Array c1 was allocated, stat = 0
Segmentation fault (core dumped)

Technical Problem Report 3856


cat pack.f90
PROGRAM PACK1

INTEGER, DIMENSION(100) :: ARRAY2,ARRAY1

INTEGER :: X,Y

array2 = pack(array1, mod(array1,x) <= y) ! compiles
array2 = pack(array1, mod(array1-1,x) <= y) ! compiles
array2 = pack(array1, ((mod(array1-1,x)+1) <= y)) ! internal
compiler error

STOP
END PROGRAM PACK1

> pgf90 pack.f90
PGF90-F-0000-Internal compiler error. rewrite_sub_args: can't find
array 116 (pack.f90: 9)
PGF90/any Linux/x86-64 6.1-6: compilation aborted

Technical Problem Report 3857


User code fails at -O2 with Win64 compilers, not with linux86-64 compilers.

/*
	MTEST.C   Test memory access
*/
#include 
#include 
#include 
#include 
#include 
#include  
//#include 
//#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#define FALSE 0
#define TRUE ~FALSE

#define MAX  219490000*5
#define N 1061900000

unsigned long *array;

void main ()
{
	test_access();
	exit (0);
}

int test_access ()
{
unsigned long n;

	printf ("MAX = %ld\n", MAX);	
	array = (unsigned long *) malloc (sizeof (unsigned long) * MAX);		
	if (errno == ENOMEM) {
		printf ("ENOMEM allocation failed\n");
		getch();
		exit (1);
	}
	if (array == NULL) {
		printf ("ERROR allocation memory: array\n");
		getch();
		exit (1);
	}
	printf ("N=%ld\n", N);
	for (n = 0; n < N+1; n++) {
		array [n] = n;
		if (n == N)
			printf ("loop: array=%ld\n", array [n]);
		
	}
	n--;
	printf ("after: n=%ld\n", n);
	printf ("after: array= %ld\n", array [n]);
	n = N;
	printf ("after2: n=%ld\n", n);
	printf ("after2: array= %ld\n", array [n]);
}

-O1 -o mtest_win mtest_win.c

PGC$ mtest_win
MAX = 1097450000
N=1061900000
loop: array=1061900000
after: n=1061900000
after: array= 1061900000
after2: n=1061900000
after2: array= 1061900000

pgcc -O2 -o mtest_win mtest_win.c

PGC$ mtest_win
MAX = 1097450000
N=1061900000
loop: array=1061900000
after: n=1061900000
after: array= 1061900000
after2: n=1061900000
Error: segmentation violation

Technical Problem Report 3858


User code causes 'unknown intrinsic' error.

% pgf90 -c *.F90
buildH0.F90:
Lowering Error: unknown intrinsic function [ast=851,asttype=14,datatype=6]
Lowering Error: unknown intrinsic function [ast=855,asttype=14,datatype=6]
Lowering Error: unknown intrinsic function [ast=867,asttype=14,datatype=6]
Lowering Error: unknown intrinsic function [ast=870,asttype=14,datatype=6]
PGF90-F-0000-Internal compiler error. Errors in Lowering 4 (buildH0.F90: 136)
PGF90/any Linux/x86 6.1-6: compilation aborted


Technical Problem Report 3859


PGI version of 'byteswap.h' works as gcc does.



Technical Problem Report 3860


% pgcc -o test testcase2.c -lc -lgcc -lpthread -V -tp k8-32
% test
FAILURE: want 20000000 but got 19687177

% gcc -o test testcase2.c -lpthread
% ./test
SUCCESS

Technical Problem Report 3861


> cat test.F
#if (!defined BAD_WAY && !defined OK_WAY)
#error WAY not defined
#endif
program test
real Mass(28,28,28),V(28,28,28)

interface global_cshift
FUNCTION CSHIFT_REAL (X)
implicit none
real cshift_real(28,28,28)
real X(28,28,28)
end function cshift_real
end interface

do i = 1, 1000
call mallinfo (1)
Mass = global_cshift( Mass)
call mallinfo (0)
#ifdef BAD_WAY
where (Mass.gt.0) V = global_cshift(V)
#else
where (Mass.gt.0)
V = global_cshift(V)
end where
#endif

end do
end

FUNCTION CSHIFT_REAL (X)
implicit none
real cshift_real(28,28,28)
real X(28,28,28)
cshift_real = cshift(X, 1, 1)
end


> cat mallinfo.c
#include 
#include 

void mallinfo_ (int *c) {

struct mallinfo mi;
struct mallinfo mallinfo (void);
static int u;

mi = mallinfo ();
if (*c == 1) {
u = mi.uordblks;
} else {
u = mi.uordblks - u;
if (u > 0) {
fprintf (stderr, "mallinfo: uordblks grew by = %dn", u);
}
}


pgf90 -DOK_WAY -o t_ok t.F90 mallinfo.c -tp k8-64
pgf90 -DBAD_WAY -o t_bad t.F90 mallinfo.c -tp k8-64

% ./t_ok
mallinfo: uordblks grew by = 87856 <----------once!!
% ./t_bad
mallinfo: uordblks grew by = 87856
mallinfo: uordblks grew by = 87856
......many times before it quits
mallinfo: uordblks grew by = 87856 <---------------many times!

Technical Problem Report 3862


% cat ptr_test.f
program ptr_test
complex filter1(64), filter2(1)
pointer (ptr_filter2,ptr_filter2)
c pointer (ptr_filter2,filter2)

ptr_filter2=loc(filter1(1))

end

% gfortran ptr_test.f
In file ptr_test.f:3

pointer (ptr_filter2,ptr_filter2)
1
Error: Unclassifiable statement at (1)

% pgf90 -c -o ptr_test.o ptr_test.f -V -tp k8-64

pgf90 6.1-6 64-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGF90/any Linux/x86-64 6.1-6
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.

still waiting....................................

pgf77 hangs as well

Technical Problem Report 3864


adding the assignment
set DEFC99=;
to the siterc file should disable -c99 by default; adding
set DEFC99=1;
in the siterc, or a user's .pgccrc file, with re-enable it.

The opposite of -c99 is -c89

Technical Problem Report 3866


% cat test.f90
module testmod
real sc(2,2) /0.0001, 0.0001, 0.0001, 0.0001/
end module testmod
program test
use testmod
print *, "Hello world"
end program test
% pgf90 -c test.f90 -V
pgf90-Fatal-/tmp/pgi616/linux86/6.1/bin/newcg/pgf901 TERMINATED by signal 11

Technical Problem Report 3868


User code creates an internal compiler error with -Mipa.

pgf90 -Minfo=all -Kieee -fastsse -tp=k8-64 -Mipa=fast,inline -fastsse -tp=k8-64
-Mipa=fast,inline -Mfree -Mextend -Mpreprocess typhon.o Fmixed_adt.o Ftypes.o
Fvariables.o Fallocate_overflow.o Fallocates.o Fdynamic.o Fhydra.o Fcycle.o -o
hydra
IPA: no IPA optimizations for 2 source files
IPA: Recompiling Fallocates.o: new IPA information
alloc_quantity:
249, IPA: module subprogram allocate_overflowr_volume inlined, size 64
432, IPA: module subprogram allocate_overflowi_volume inlined, size 63
dealloc_quantity:
625, IPA: module subprogram allocate_overflowr_volume inlined, size 64
751, IPA: module subprogram allocate_overflowi_volume inlined, size 63
IPA: Recompiling Fdynamic.o: new IPA information
PGF90-S-0000-Internal compiler error. compute_sdsc_subscr: not PLD 12363
(Fdynamic.f: 20)
PGF90-S-0000-Internal compiler error. compute_sdsc_subscr: not MEMBER 3
.....and so on.

Technical Problem Report 3870




Technical Problem Report 3872


User code compiles with -O1, but causes the compiler to hang at -O2.



Technical Problem Report 3873


Code fails on Win32 only.

pgf90 -O0 -Mfree -c orbitalhessian.f
PGF90-F-0010-File write error occurred (data init file) (orbitalhessian.f)
PGF90/x86 nt86 6.0-8: compilation aborted

Technical Problem Report 3877


It appears that following the sequence

30 continue
rewind nx
endfile nx
rewind nx

a read statement with an end= clause

read (nx, err=40, end=50, iostat=ios) nn,(a(i),i=1,min(nn, n))

is not correctly recognizing that the file is currently positioned at
the end of the file.

Technical Problem Report 3878


% more test.f90
Implicit none
Type blah
Integer :: foo
End Type blah
Type(blah) :: myarray(2)
Data myarray(:) % foo /100, 200/
Print *,myarray(:) % foo
End
% pgf90 -c test.f90 -V
PGF90-S-0067-Too many data constants in initialization statement (test.f90: 6)
0 inform, 0 warnings, 1 severes, 0 fatal for MAIN

Technical Problem Report 3880


User code fails on 6.0-8 Win32. Corrected.

pgf90 -Munix -c *.f
everything goes well, until

PGF90-F-0010-File write error occurred (data init file) (cc_iorsp.f)
PGF90/x86 nt86 6.0-8: compilation aborted

Technical Problem Report 3881


> cat test.f90
real time

time=-100.
if ( time .eq. 0) 100,101,102
100 time=-1.
go to 103
101 time=0.
go to 103
102 time=1.
103 print *, time

time=-0.
if ( time .eq. 0) 200,201,202
200 time=-1.
go to 203
201 time=0.
go to 203
202 time=1.
203 print *, time

time=100.
if ( time .eq. 0) 300,301,302
300 time=-1.
go to 303
301 time=0.
go to 303
302 time=1.
303 print *, time

end

> pgf90 test.f90
ILM file line 101: unknown operation: LAIF i16 s526 s527 s528
ILM file line 195: unknown operation: LAIF i16 s541 s542 s543
ILM file line 289: unknown operation: LAIF i16 s546 s547 s548
PGF90-F-0000-Internal compiler error. Errors in ILM file 3 (test.f90: 30)

Technical Problem Report 3882


$ cat hdf5_fail.c

typedef struct H5O_layout_t {
unsigned int type;
unsigned int last;
} H5O_layout_t;

void H5F_addr_decode2 ( const unsigned char * * ) ;

extern H5O_layout_t *mesg;

void H5O_layout_decode ( const unsigned char *p )
{
if ( *p++ > 33 )
printf("errorn");
mesg->type = *p++ ;
p += 5 ;

#ifdef WORK
printf("H5O_layout_decode: before H5F_addr_decode - p: %lxn", p);
#else
printf("H5O_layout_decode: before H5F_addr_decode - n");
#endif

H5F_addr_decode2 ( &p );

mesg->last = *p ;
}

$ cat hdf5_main.c

typedef struct H5O_layout_t {
unsigned int type;
unsigned int last;
} H5O_layout_t;

void H5F_addr_decode2 ( const unsigned char **p ) { return; }

H5O_layout_t MESG;
H5O_layout_t *mesg;
char P[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

int main() {
mesg = &MESG;
H5O_layout_decode(P);
printf("mesg->last = %dn",mesg->last);
}

$ pgcc hdf5_fail.c hdf5_main.c && ./a.out
hdf5_fail.c:
hdf5_main.c:
H5O_layout_decode: before H5F_addr_decode -
mesg->last = 9 <--- Wrong!!!!!!
$ pgcc -DWORK hdf5_fail.c hdf5_main.c && ./a.out
hdf5_fail.c:
hdf5_main.c:
H5O_layout_decode: before H5F_addr_decode - p: 5006d7
mesg->last = 8 <--- Correct

Technical Problem Report 3884


Python code was building improperly. It does now.



Technical Problem Report 3885


.FOR extension was not handled properly.

we accept

pgf77/pgf90 hello.for

but not

pgf77 hello.FOR ! implying preprocessing.

% pgf77 hello.FOR
File with unknown suffix passed to linker: hello.FOR
/usr/bin/ld:hello.FOR: file format not recognized; treating as linker script
/usr/bin/ld:hello.FOR:1: syntax error

Technical Problem Report 3886


It appears that a subroutine-scope allocatable array is *not* being deallocated on return from the subroutine as required by Fortran 95.



Technical Problem Report 3889


SHAPE fails with -i8.

%cat setaa.f90
program setaa
real(kind=8)::p(0:5,0:5,0:5,1,0:0)
print*,"setaa shape p ", shape(p)
return
end program setaa
% pgf90 setaa.f90
% ./a.out
setaa shape p 6 6 6 1
1
% pgf90 setaa.f90 -i8
% ./a.out
setaa shape p 25769803782 4294967302
1 0 4344992

Technical Problem Report 3887


Program gives wrong answers with MINLOC, MAXLOC

PROGRAM essai

 INTEGER :: jpi=10, jpj=10
 REAL(8),DIMENSION(jpi,jpj) :: zlon

 zlon=0.e0
 zlon(10,10)=1.
 WRITE(*,*) MINLOC(zlon)
 WRITE(*,*) MAXLOC(zlon)

 END PROGRAM essai
% pgf90 -o test test.f90 -V -tp k8-64 -mcmodel=medium
% ./test
1 0
10 0
now fixed

% pgf90 -o test test.f90 -V -tp k8-64 -mcmodel=medium
% ./test
1 1
10 10

Technical Problem Report 3890


User code causes compiler errors.

% pgf95 -c vector_m.f90 -V

% pgf95 -c test.f90 -V

PGF90-F-0000-Internal compiler error. rewrite_sub_args: can't find array 35 (test.f90: 8)
PGF90/any Linux/x86-64 6.1-6: compilation aborted

Technical Problem Report 3895


User code caused pgf90 to terminate.

% pgf90 -c test.f -g -Minline

pgf90-Fatal-/tmp/pgi616/linux86-64/6.1/bin/pgf902 TERMINATED by signal 11

Technical Problem Report 3896


User code causes compilation failure.

% pgf90 -c -byteswapio module_report.f -V6.1-5 -Mfree
ILM file: can't find intrinsic ceiling
ILM file line 2459: unknown symbol operand 389
ILM file line 2506: unknown symbol operand 389
PGF90-F-0000-Internal compiler error. Errors in ILM file 3 (module_report.f: 162)
PGF90/x86 Linux/x86-64 6.1-5: compilation aborted



Technical Problem Report 3897


User code breaks the compiler.

pgf90 uf600.f90
PGF90-W-0000-Internal compiler error. ast_visit sees ast of 0 0 (uf600.f90: 41)
Lowering Error: unknown intrinsic function [ast=65,asttype=14,datatype=60]
intr-func-call hshlk/std: 0 type:array (1:z_i_0) of character*(*) alias: 0 callfg:0 opt=(0,0)
aptr: 65 lop: 64 argcnt: 4 args: 15 optype: 241
( 0): 55
( 1): 58
( 2): 0
( 3): 0
shape: 13
[0]. lwb: 3 upb: 62 stride: 3
Lowering Error: bad ilm link 0
Lowering Error: NDTYPE not set [ast=121,asttype=1,datatype=-1]
ident hshlk/std: 0 type:integer alias: 0 callfg:0 opt=(0,3)
aptr: 121 sptr: 604 (tmp$r$len)
Lowering Error: NDTYPE not set [ast=0,asttype=0,datatype=-1]
null hshlk/std: 0 opt=(0,0)
aptr: 0 
Lowering Error: bad ilm link 0
Lowering Error: NDTYPE not set [ast=0,asttype=0,datatype=-1]
null hshlk/std: 0 opt=(0,0)
aptr: 0 
Lowering Error: bad ilm link 0
PGF90-F-0000-Internal compiler error. Errors in Lowering 7 (uf600.f90: 41)
PGF90/any Linux/x86-64 Rel Dev: compilation aborted

Technical Problem Report 3901


The declaration of parameter arrays and then setting a parameter array equal to another causes problems. Corrected in 6.2-5

% cat xx.f90

MODULE GAUSS_JACKSON
   IMPLICIT NONE
   REAL(8), PARAMETER :: ACOEF(-8:1,-8:0) = RESHAPE(                     &
      SHAPE = (/10,9/), SOURCE = (/                                      &
      0.610726498617124D-01,-.206778223705307D-02,0.287541837021004D-03, &
      -.657429954304954D-04,0.138976571268238D-04,0.138976571268238D-04, &
      -.657429954304954D-04,0.287541837021004D-03,-.206778223705307D-02, &
      0.610726498617124D-01,0.100438587261504D+00,0.796826899951900D-01, &
      -.465565877024210D-02,0.879228795895463D-03,-.190821909571910D-03, &
      -.111181257014590D-03,0.605584616001283D-03,-.265361952861953D-02, &
      0.188975819704986D-01,-.551721630992464D+00,-.217995455547539D+00, &
      0.259984267275934D-01,0.900341961279461D-01,-.702240660573994D-02, &
      0.137954445246112D-02,0.309493746993747D-03,-.247792909251243D-02, &
      0.109570907487574D-01,-.770937800625301D-01,0.221751297699214D+01, &
      0.302602738696489D+00,-.443017476350810D-01,0.184491241782908D-02, &
      0.955566077441077D-01,-.818980980439314D-02,0.212141253807920D-03, &
      0.583190536315536D-02,-.266314434022767D-01,0.184650798661215D+00, &
      -.520719636844637D+01,-.287172005270964D+00,0.420621768278018D-01, &
      -.807147617043450D-02,-.643870500641334D-02,0.973077125420875D-01, &
      -.643870500641334D-02,-.807147617043450D-02,0.420621768278018D-01, &
      -.287172005270964D+00,0.787980468123697D+01,0.184650798661215D+00, &
      -.266314434022767D-01,0.583190536315536D-02,0.212141253807920D-03, &
      -.818980980439314D-02,0.955566077441077D-01,0.184491241782908D-02, &
      -.443017476350810D-01,0.302602738696489D+00,-.798232588784672D+01, &
      -.770937800625301D-01,0.109570907487574D-01,-.247792909251243D-02, &
      0.309493746993747D-03,0.137954445246112D-02,-.702240660573994D-02, &
      0.900341961279461D-01,0.259984267275934D-01,-.217995455547539D+00, &
      0.543270532708033D+01,0.188975819704986D-01,-.265361952861953D-02, &
      0.605584616001283D-03,-.111181257014590D-03,-.190821909571910D-03, &
      0.879228795895463D-03,-.465565877024210D-02,0.796826899951900D-01, &
      0.100438587261504D+00,-.241661085056918D+01,-.206778223705307D-02, &
      0.287541837021004D-03,-.657429954304954D-04,0.138976571268238D-04, &
      0.138976571268238D-04,-.657429954304954D-04,0.287541837021004D-03, &
      -.206778223705307D-02,0.610726498617124D-01,0.650092436016915D+00 /) )
   REAL(8), PARAMETER :: BCOEF(-8:1,-8:0) = RESHAPE(                     &
      SHAPE = (/10,9/), SOURCE = (/                                      &
      0.213024553571429D+00,0.789255401234568D-02,-.146398258377425D-02, &
      0.546875000000000D-03,-.344053130511464D-03,0.344053130511464D-03, &
      -.546875000000000D-03,0.146398258377425D-02,-.789255401234568D-02, &
      0.286975446428571D+00,-.589019786155203D+00,0.141991567460317D+00, &
      0.210683972663139D-01,-.638585758377425D-02,0.364335317460317D-02, &
      -.344053130511464D-02,0.526592813051146D-02,-.137227182539683D-01, &
      0.724969686948854D-01,-.259067157186949D+01,0.964014825837743D+00, &
      -.304887841710758D+00,0.892881944444444D-01,0.407558972663139D-01, &
      -.187717702821869D-01,0.160292658730159D-01,-.231280313051146D-01, &
      0.579693011463845D-01,-.297854662698413D+00,0.104036130401235D+02, &
      -.124089037698413D+01,0.301040288800705D+00,-.181913304673721D+00, &
      0.433506944444444D-01,0.696563602292769D-01,-.476722332451499D-01, &
      0.619667658730159D-01,-.146102568342152D+00,0.720943838183422D+00, &
      -.244037921626984D+02,0.114056437389771D+01,-.246428571428571D+00, &
      0.116578483245150D+00,-.113007054673721D+00,0.000000000000000D+00, &
      0.113007054673721D+00,-.116578483245150D+00,0.246428571428571D+00, &
      -.114056437389771D+01,0.368798500881834D+02,-.720943838183422D+00, &
      0.146102568342152D+00,-.619667658730159D-01,0.476722332451499D-01, &
      -.696563602292769D-01,-.433506944444444D-01,0.181913304673721D+00, &
      -.301040288800705D+00,0.124089037698413D+01,-.372994706238977D+02, &
      0.297854662698413D+00,-.579693011463845D-01,0.231280313051146D-01, &
      -.160292658730159D-01,0.187717702821869D-01,-.407558972663139D-01, &
      -.892881944444444D-01,0.304887841710758D+00,-.964014825837743D+00, &
      0.253468278769841D+02,-.724969686948854D-01,0.137227182539683D-01, &
      -.526592813051146D-02,0.344053130511464D-02,-.364335317460317D-02, &
      0.638585758377425D-02,-.210683972663139D-01,-.141991567460317D+00, &
      0.589019786155203D+00,-.112951308972663D+02,0.789255401234568D-02, &
      -.146398258377425D-02,0.546875000000000D-03,-.344053130511464D-03, &
      0.344053130511464D-03,-.546875000000000D-03,0.146398258377425D-02, &
      -.789255401234568D-02,-.213024553571429D+00,0.317179880401235D+01 /) )
   REAL(8), PARAMETER :: A0(-4:4, -4:4) = ACOEF(-8:0, :)
   REAL(8), PARAMETER :: B0(-4:4, -4:4) = BCOEF(-8:0, :)
END MODULE GAUSS_JACKSON

% pgf90 -c xx.f90 -V

pgf90 6.2-4 32-bit target on x86 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/any Linux/x86 6.2-4
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
PGF90-S-0067-Too many data constants in initialization statement (xx.f90: 82)
PGF90-S-0067-Too many data constants in initialization statement (xx.f90: 83)
  0 inform,   0 warnings,   2 severes, 0 fatal for gauss_jackson

Technical Problem Report 3902


Example in INSTALL.txt needs correction

DAEMON pgroupd /linux86/bin/pgroupd

should be linux86/6.1/bin/pgroupd

Technical Problem Report 3906


Program below that uses a call through function pointer expression works on gcc and generates consistent runtime segfaults on PGI 6.1-6, back to at least 6.1-1.

#include 
#include 
/* to see problem:
pgcc pgi-bug-fnptr.c && ./a.out
-or-
pgcc -DUSE_NULL pgi-bug-fnptr.c && ./a.out
*/

void bar(int x, ...) {
printf("in barn"); fflush(stdout);
{
va_list _ap; va_start(_ap,x);
printf("bar(%i, %i)n",x, va_arg(_ap,int));
va_end(_ap);
}
}

void (*pfn)(int, ...);

int main() {
(*(pfn ? pfn : &bar))(111,222);
return 0;
}

void foo(int x, ...) {
printf("in foon"); fflush(stdout);
{
va_list _ap; va_start(_ap,x);
printf("foo(%i, %i)n",x, va_arg(_ap,int));
va_end(_ap);
}
}
void (*pfn)(int, ...) =
#ifdef USE_NULL
NULL;
#else
&foo;
#endif

Technical Problem Report 3909


User program caused execution errors with -O2, workaround to use -O2 -Mnoframe, or -fast

newcg has trashed the stack with recursively calling cgopt2rg.c:spill_local():

...
[2] spill_local(cand = 91, first = 1, last = 8), line 4201 in "cgopt2rg.c"
[3] spill_local(cand = 91, first = 1, last = 8), line 4207 in "cgopt2rg.c"
[4] spill_local(cand = 91, first = 1, last = 8), line 4207 in "cgopt2rg.c"
[5] spill_local(cand = 91, first = 1, last = 8), line 4207 in "cgopt2rg.c"
[6] spill_local(cand = 91, first = 1, last = 8), line 4207 in "cgopt2rg.c"
[7] spill_local(cand = 91, first = 1, last = 8), line 4207 in "cgopt2rg.c"
[8] spill_local(cand = 91, first = 1, last = 8), line 4207 in "cgopt2rg.c"
...

Technical Problem Report 3913


Add SITERPATH to the already defined SITELIB, SITEINC, and SITEDEF


Technical Problem Report 3914


Customer reported problem with the F90 intrinsic random_number when called in single precision. The customer provided the following test program to exhibit the problem:

====rndnum-bug.f90====
program main
implicit none
real, parameter :: one = 1.0
real :: rnd
integer :: i
i = 0
do
i = i + 1
call random_number (rnd)
if ( rnd == one ) then
write(*,*) i
exit
end if
end do
end program main
============

pgf90 rndnum-bug.f90
./a.out
53496542

Since random_number should produce values in the range 0 <= x < 1 this program should end up as an infinite loop. However, after generating 53496541 random numbers, a 1.0 is generated which is incorrect.

The problem is a type conversion from double to float. 

*hb = seed_lf[offset];

The following program demonstrates this type conversion problem:

main()
{

/* 0x3FEFFFFFFCED4E00 */

double x = 0.99999999427603825;
float y = 0.0;

y = x;
printf("Resultant value....: %fn",y);
}


% gcc x.c
% ./a.out
Resultant value....: 1.000000

Technical Problem Report 3915


Customer reported that the following program no longer works correctly when using the 6.1 or 6.2 compilers:

integer, parameter :: db = selected_real_kind(p=8,r=40)
real(kind=db), parameter :: eps7=dble(1.0e-7)

print *, 'Eps7 ', eps7

end

% pgf90 y.f90
% ./a.out
Eps7 532.0000000000000 <------- This is incorrect


Using the 6.0 compiler yields the following result

Eps7 1.0000000116860974E-007


Technical Problem Report 3920


pgCC should take advantage of g++ __restrict pointers. User code not compiling optimally due to cdefs.h problems. We have fixed with our own cdefs.h file that links ahead of the system version, and corrects the problem.

void foo(double * __restrict Pedata, double * __restrict Psn1x,
double * __restrict Psn1y,
double * __restrict Ptn1x,
double * __restrict Ptn1y,
int n, int jc)
{
double * __restrict Psn2x = Psn1x + jc; /* jc guaranteed >= n */
double * __restrict Psn2y = Psn1y + jc;
double * __restrict Ptn2x = Ptn1x + jc;
double * __restrict Ptn2y = Ptn1y + jc;
double bx0, bx1, by0, by1, pbx0, pbx1, pby0, pby1;
int i;

if (n > 0) {
i = 0;
bx0= Pedata[i]*(Psn2y[i] - Psn1y[i+1]);
bx1= Pedata[i]*(Psn2y[i+1] - Psn1y[i]);
by0= Pedata[i]*(Psn2x[i] - Psn1x[i+1]);
by1= Pedata[i]*(Psn1x[i] - Psn2x[i+1]);

Ptn1x[i] = -bx0;
Ptn1y[i] = -by0;

Ptn2x[i] = -bx1;
Ptn2y[i] = -by1;

for (i = 1; i < n; i++) {
bx0 = Pedata[i]*(Psn2y[i] - Psn1y[i+1]);
pbx0 = Pedata[i-1]*(Psn2y[i-1] - Psn1y[i]);

bx1 = Pedata[i]*(Psn2y[i+1] - Psn1y[i]);
pbx1 = Pedata[i-1]*(Psn2y[i] - Psn1y[i-1]);

by0 = Pedata[i]*(Psn2x[i] - Psn1x[i+1]);
pby0 = Pedata[i-1]*(Psn2x[i-1] - Psn1x[i]);

by1 = Pedata[i]*(Psn1x[i] - Psn2x[i+1]);
pby1 = Pedata[i-1]*(Psn1x[i-1] - Psn2x[i]);

Ptn1x[i] = pbx1 - bx0;
Ptn1y[i] = pby1 - by0;

Ptn2x[i] = pbx0 - bx1;
Ptn2y[i] = pby0 - by1;
}
}
}


Technical Problem Report 3924


Installation notes have changed the default installation directory from /usr/pgi to /opt/pgi But the license startup script lmgrd.rc still refers to /usr/pgi.


Technical Problem Report 3926


pgf90 causes Internal Compiler Errors (ICE) on user program.

pgf90 6.2-3 32-bit target on x86 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGF90/any Linux/x86 6.2-3
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGF90-S-0000-Internal compiler error. name_dependent: unexpected ast 999 (NRUTIL.F90: 648)
PGF90-S-0000-Internal compiler error. name_dependent: no names 0 (NRUTIL.F90: 648)
PGF90-S-0000-Internal compiler error. name_dependent: unexpected ast 999 (NRUTIL.F90: 648)
PGF90-S-0000-Internal compiler error. name_dependent: no names 0 (NRUTIL.F90: 648)
PGF90-F-0000-Internal compiler error. rewrite_sub_args: can't find array 1008 (NRUTIL.F90: 648)
PGF90/any Linux/x86 6.2-3: compilation aborted

Technical Problem Report 3932


Code compiles properly now with pgcc when -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE is added to the compile line.

% cat main.f90
program main

  use def_routine
  implicit none
 
  integer, parameter :: n = 5
  real(kind=8), dimension(n)   :: t1
  real(kind=8), dimension(n)   :: t2
  real(kind=8), dimension(2*n) :: t3

  t2 = 2.d0
  t3 = 3.d0

  call routine(n, t1, t2)

end program

% cat routine.f90
subroutine routine(n, tab1, tab2, tab3)
  
  implicit none

  integer,intent(in) :: n
  real(kind=8), dimension(n)  , intent(out)           :: tab1
  real(kind=8), dimension(n)  , intent(in)            :: tab2
  real(kind=8), dimension(2*n), intent(in),  optional :: tab3
  
  if (present(tab3)) then
    tab1(1:n) = tab2(1:n) + tab3(1:n)
    return
  else
    tab1(1:n) = tab2(1:n) 
    return
  end if

end subroutine routine

% cat def_routine.f90
module def_routine

interface
  subroutine routine(n, tab1, tab2, tab3)
      integer,intent(in) :: n
      real(kind=8), dimension(n)  , intent(out)           :: tab1
      real(kind=8), dimension(n)  , intent(in)            :: tab2
      real(kind=8), dimension(2*n), intent(in),  optional :: tab3
  end subroutine routine
end interface

end module def_routine


% pgf90 -c def_routine.f90 -V

pgf90 6.2-3 32-bit target on x86 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGF90/any Linux/x86 6.2-3
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGF90/x86 Linux/x86 6.2-3
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
% pgf90 -c main.f90
Lowering Error: array upper bound is not a symbol for datatype 39
PGF90-F-0000-Internal compiler error. Errors in Lowering 1 (main.f90: 16)
PGF90/any Linux/x86 6.2-3: compilation aborted


Technical Problem Report 3935


Compiler bombs out during object linking, reports a "Argument list too long" message on one line, followed by a "Error 126" on the next... Many arguments and long pathnames combine to overwhelm the 6.1 driver. This has been addressed in 6.2 with larger buffers.


Technical Problem Report 3936


Extended asm correct at -O1, wrong at -O2

% more test.c
int main(void) {
int foo;
char bar;

#if 1
/* Just something to ensure %eax gets a known initial value */
__asm__ __volatile__ ( "movl $0x12345678, %0" : "=a" (foo) );
#endif

/* Now the asm() with the buggy behavior: */
__asm__ __volatile__ ( "movb $0x55, %b0" : "=a" (bar) );

printf("  value 0x%x\n", (int)bar);

return 0;
}
% pgcc -O1 -o test1 test.c
% ./test1
  value 0x55
% pgcc -O2 -o test2 test.c
% ./test2
  value 0x12345655


Technical Problem Report 3937


C program causes pgcc to Terminate with Signal 11.

% cat test.c
#include 
void bug(uint64_t v) { __asm__ __volatile__ ( "" : "+&q" (v) ); }

% pgcc -tp k8-32 -V -c test.c

pgcc 6.2-3 32-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGC/x86 Linux/x86 6.2-3
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
pgcc-Fatal-/tmp/pgi623/linux86/6.2/bin/newcg/pgc TERMINATED by signal 11
Arguments to /tmp/pgi623/linux86/6.2/bin/newcg/pgc
/tmp/pgi623/linux86/6.2/bin/newcg/pgc test.c -opt 1 -version -terse 1 -inform warn 
-x 119 0xa10000 -x 119 0x100000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 127 16 
-x 119 0x40000000 -x 19 0x400000 -x 28 0x40000 -x 59 4 -x 119 0x8000000 -astype 0 
-stdinc /tmp/pgi623/linux86/6.2/include:/usr/local/include:/usr/lib/gcc/x86_64-redhat-linux/4.1.0/include:
/usr/lib/gcc/x86_64-redhat-linux/4.1.0/32/include:/usr/include -def unix -def __unix 
-def __unix__ -def linux -def __linux -def __linux__ -def i386 -def __i386 -def __i386__ 
-def __NO_MATH_INLINES -def linux86 -def __THROW= -def __extension__= -def __SSE__ 
-def __MMX__ -def __SSE2__ -predicate '#machine(i386) #lint(off) #system(unix) #system(posix) 
#cpu(i386)' -cmdline '+pgcc test.c -tp k8-32 -V -c' -x 123 4 -x 123 0x80000000 
-alwaysinline /tmp/pgi623/linux86/6.2/lib/libintrinsics.il 4 -x 80 0x08000000 
-y 80 0x1000 -asm /tmp/pgccAEteo6cFdiOa.s

Technical Problem Report 3938


User example caused an overflow in an internal representation. We have enlarged the table filled, and this problem should not occur again.

pgf90 -c -fastsse test.f90
PGF90-F-0007-Subprogram too large to compile at this optimization level (test.f90)
PGF90/x86 Linux/x86-64 6.2-2: compilation aborted

Technical Problem Report 3941


pgcc fails on lines like __asm__ __volatile__

% pgcc a.c -O2 -S
PGC-F-0000-Internal compiler error. gasm_process_constraint: (loc1) Could not find store associated with output item 7 (a.c: 3)
PGC/x86-64 Linux/x86-64 6.2-2: compilation aborted

% cat a.c
int main(int argc, char *argv[])
{
long int compval = 10;
volatile long int *p = &compval;
long int oldval = 10;
long int newval = 20;
char ret;
long int readval;
__asm__ __volatile__ ("lock; cmpxchgq %3, %1; sete %0"
: "=q" (ret), "=m" (*p), "=a" (readval)
: "r" (newval), "m" (*p), "a" (oldval) : "memory");
return (compval == 20) ? 0 : -1;
}

Technical Problem Report 3943


Documentation indicated that -Mbounds was the default setting. This is not the case, and the documentation has been corrected.


Technical Problem Report 3944


Program segfaults on execution after compiling with 6.2-3 pgf77, but not with the 6.1 compiler.

% cat g.f
program g
integer In
integer IOut
parameter (In = 5)
parameter (IOut = 6)
c
Open(In)
Open(IOut)
c
read (unit=In,*) i
write (unit=IOut,*) i
c
end
% pgf77 g.f
% ./a.out
Segmentation fault

Technical Problem Report 3950


User sees this following problems when linking on latest compilers with an previously compiled object. This change has been addressed.

../lib/libpgc.so: undefined reference to '__pgi_tracee'
> >> ../lib/libpgc.so: undefined reference to '__pgi_trace'

Technical Problem Report 3952


User program caused the 6.1-6 compiler to hang when compiling -O2. This problem has been corrected.


Technical Problem Report 3953


pgf90 fails when reading namelist formated input with commas.

% more test.f
program test
integer ivar(6)
namelist /name/ ivar
read(*,name)
write(*,*) ivar
end
% cat tmp.in
$NAME
ivar = ,,1,,999,
$END

% pgf77 -o test_77 test.f -V

pgf77 6.2-3 64-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGFTN/x86-64 Linux/x86-64 6.2-3
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.

% pgf77 -o test_77 test.f -V

pgf77 6.2-3 64-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGFTN/x86-64 Linux/x86-64 6.2-3
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
% pgf77 -o test_77_32 test.f -V -tp k8-32

pgf77 6.2-3 32-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGFTN/x86 Linux/x86 6.2-3
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
% pgf90 -o test_90 test.f
% pgf90 -o test_90_32 test.f -tp k8-32
% gfortran -o test_gfort test.f

% ./test_77 < tmp.in
0 0 1 0 999 0
% ./test_77_32 < tmp.in
0 0 1 0 999 0
% ./test_90 < tmp.in
0 0 999 0 0 0
% ./test_90_32 < tmp.in
0 0 999 0 0 0


Technical Problem Report 3954


Preprocesor fails when the macro argument has very large text string or if there are many recursive macro expansions.

Error:
PGC-S-0204-Actual parameters too long for SET_MSG_WARNING (./msg.c: 149)

Technical Problem Report 3956


Customer problems with -Mextract

% pgf90 -Mextract=sub a.f -o FOO
gives
% pgf90-Fatal-Unable to create file /TOC

Told him to replace '-o FOO' with '-Mextract=lib:FOO' (which works).

Don't know if the old method of using -o is actually supposed to work; if it's not,
the error message is misleading.


Technical Problem Report 3957


Documentation wrongly indicated Fedora Core 5 did not have NUMA, and wrongly indicated SuSE 10 did not support New Posix Thread Library (NPTL)>

======== on the Fedora Core 5 System ===================
$ cat /etc/issue
Fedora Core release 5 (Bordeaux)
Kernel \r on an \m
getconf GNU_LIBPTHREAD_VERSION
NPTL 2.4
$ numactl --hardware
available: 2 nodes (0-1)
node 0 size: 2011 MB
node 0 free: 549 MB
node 1 size: 1952 MB
node 1 free: 530 MB

========= on the SLES 10 System ==================
$ cat /etc/issue

Welcome to SUSE Linux Enterprise Server 10 (x86_64) - Kernel \r (\l).
$ getconf GNU_LIBPTHREAD_VERSION
NPTL 2.4
$ numactl --show
policy: default
preferred node: current
physcpubind: 0 1 2 3
cpubind: 0
nodebind: 0
membind: 0

Technical Problem Report 3958


The 32-bit PGI 6.2-3 download did not install properly on Red Hat 8.0. This was fixed.


Technical Problem Report 3959


If you install the 6.2-3 compilers in a path with X86-64 in it, the installation fails. This has been corrected.


Technical Problem Report 3969


User seeing an undefined reference to __builtin_stinit when linking a VC++ compiled program with ACML. ACML is built using PGF90 as a shared library.

Put this in a file named tarry.f:

subroutine tarry(w)
integer j
double precision w, x(2000), sum
do j = 1, 2000
x(j) = j
end do
sum = 0.0d0
do j = 1, 2000
sum = sum + x(j)
end do
w = sum
return
end

Under win32, compile it like this:

pgf77 -c -mslibs -msvcrt -Mdll -Mreentrant tarry.f

Then examine the object file and you see this undefined symbol:

00B 00000000 UNDEF notype External | ___builtin_stinit

(it gets used because of the -Mreentrant switch to pgf77).

If you then create a DLL out of tarry.obj, you need to add libpgc.lib
to the DLL creation line in order to get hold of __builtin_stinit:

link /dll /machine:IX86 /out:tarry.dll /export:_TARRY@4
-defaultlib:msvcrt -libpath:c:\Progra~1\pgi\win32.2-3/lib
-defaultlib:libpgc tarry.obj

Under win64, the symbol __builtin_stinit appears in the DLL
run-time library pgc.dll, as well as the static library libpgc.lib,
whereas under win32 __builtin_stinit is not in pgc.dll.


Technical Problem Report 3976


C++ problem with nameless struct typedef

% more bug.cxx


#include   // comment this line out for a successful build
#include 

char *sprintv(const char *fmt,std::va_list args);

void sprint(const char *fmt,...)
{
    va_list args;
    va_start(args,fmt);
    sprintv(fmt,args);
    va_end(args);
}

int main()
{
    sprint("%d",1);
}


% more bug1.cxx


#include 
#include 

char *sprintv(const char *fmt,std::va_list args)
{
    char *msgbuf = 0;
    return msgbuf;
}

% more va_list.h
/* 
* va_list.h
*
*      Copyright 1990-2000, The Portland Group, Incorporated.
*      Copyright 2000-2002, STMicroelectronics, Incorporated.
*      All rights reserved.
*
*        STMICROELECTRONICS, INCORPORATED PROPRIETARY INFORMATION
* This software is supplied under the terms of a license agreement
* or nondisclosure agreement with STMicroelectronics and may not be
* copied or disclosed except in accordance with the terms of that
* agreement.
*/

#ifndef _VA_LIST
#define _VA_LIST

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

typedef struct {
    unsigned int gp_offset;
    unsigned int fp_offset;
    char * overflow_arg_area;   /* Address of memory args area. */
    char * reg_save_area;       /* Address of where we stored the regs. */
} __pgi_va_list[1];

typedef __pgi_va_list va_list;

#if defined(__linux__)
#ifndef __PGI_GNUC_VA_LIST
#define __PGI_GNUC_VA_LIST
typedef __pgi_va_list __gnuc_va_list;
#endif
#endif

#if defined(__sun)
typedef va_list __va_list;
#endif



#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif



Technical Problem Report 3981


User code causes TERMINATED by Signal 6 error

% pgf90 -V -c *.f90

pgf90 6.2-4 64-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
gridgen4mod.f90:
PGF90/any Linux/x86-64 6.2-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
*** glibc detected *** /tmp/pgi624/linux86-64/6.2/bin/pgf901: free(): invalid next size (normal): 0x0000000040407
======= Backtrace: =========
/lib64/libc.so.6[0x38f166d7a3]
/lib64/libc.so.6(__libc_free+0x84)[0x38f166d924]
/tmp/pgi624/linux86-64/6.2/bin/pgf901[0x40026f15]
/tmp/pgi624/linux86-64/6.2/bin/pgf901[0x4002711c]
/tmp/pgi624/linux86-64/6.2/bin/pgf901[0x40092e92]
/tmp/pgi624/linux86-64/6.2/bin/pgf901[0x40055aeb]
/tmp/pgi624/linux86-64/6.2/bin/pgf901[0x4004595a]
/tmp/pgi624/linux86-64/6.2/bin/pgf901[0x40045393]
/tmp/pgi624/linux86-64/6.2/bin/pgf901[0x4014c857]
/lib64/libc.so.6(__libc_start_main+0xf4)[0x38f161d084]
/tmp/pgi624/linux86-64/6.2/bin/pgf901(strcat+0x4a)[0x40002b3a]
======= Memory map: ========
40000000-40234000 r-xp 00000000 03:02 3757623 /tmp/pgi624/linux86-64/6.2/bin/pgf901
40334000-4038e000 rwxp 00234000 03:02 3757623 /tmp/pgi624/linux86-64/6.2/bin/pgf901
4038e000-40472000 rwxp 4038e000 00:00 0 [heap]
38f1400000-38f1419000 r-xp 00000000 03:02 2810021 /lib64/ld-2.4.so
38f1519000-38f151a000 r-xp 00019000 03:02 2810021 /lib64/ld-2.4.so
38f151a000-38f151b000 rwxp 0001a000 03:02 2810021 /lib64/ld-2.4.so
38f1600000-38f173f000 r-xp 00000000 03:02 2810022 /lib64/libc-2.4.so
38f173f000-38f183f000 ---p 0013f000 03:02 2810022 /lib64/libc-2.4.so
38f183f000-38f1843000 r-xp 0013f000 03:02 2810022 /lib64/libc-2.4.so
38f1843000-38f1844000 rwxp 00143000 03:02 2810022 /lib64/libc-2.4.so
38f1844000-38f1849000 rwxp 38f1844000 00:00 0
38f4300000-38f430d000 r-xp 00000000 03:02 2810027 /lib64/libgcc_s-4.1.0-20060304.so.1
38f430d000-38f440d000 ---p 0000d000 03:02 2810027 /lib64/libgcc_s-4.1.0-20060304.so.1
38f440d000-38f440e000 rwxp 0000d000 03:02 2810027 /lib64/libgcc_s-4.1.0-20060304.so.1
2b90de75b000-2b90de75c000 rwxp 2b90de75b000 00:00 0
2b90de77e000-2b90de781000 rwxp 2b90de77e000 00:00 0
2b90de7a4000-2b90de7b8000 rwxp 2b90de7a4000 00:00 0
2b90de7b9000-2b90de7ba000 rwxp 2b90de7b9000 00:00 0
2b90de7ca000-2b90de811000 rwxp 2b90de780000 00:00 0
2b90de900000-2b90de921000 rwxp 2b90de900000 00:00 0
2b90de921000-2b90dea00000 ---p 2b90de921000 00:00 0
7fffff9b6000-7fffff9cc000 rwxp 7fffff9b6000 00:00 0 [stack]
ffffffffff600000-ffffffffffe00000 ---p 00000000 00:00 0 [vdso]
pgf90-Fatal-/tmp/pgi624/linux86-64/6.2/bin/pgf901 TERMINATED by signal 6
Arguments to /tmp/pgi624/linux86-64/6.2/bin/pgf901
/tmp/pgi624/linux86-64/6.2/bin/pgf901 gridgen4mod.f90 -opt 1 -version -terse 1 -inform warn -nohpf -nostatic -x 1
000 -quad -x 59 4 -x 59 4 -x 15 2 -x 49 0x400004 -x 51 0x20 -x 57 0x4c -x 58 0x10000 -x 124 0x1000 -x 57 0xfb0000
0x78031040 -x 48 4608 -x 49 0x100 -x 120 0x200 -stdinc /tmp/pgi624/linux86-64/6.2/include:/usr/local/include:/usr
c/x86_64-redhat-linux/4.1.0/include:/usr/lib/gcc/x86_64-redhat-linux/4.1.0//include:/usr/include -def unix -def _
def __unix__ -def linux -def __linux -def __linux__ -def __NO_MATH_INLINES -def __x86_64__ -def __LONG_MAX__=9223
54775807L -def '__SIZE_TYPE__=unsigned long int' -def '__PTRDIFF_TYPE__=long int' -def __THROW= -def __extension_
__amd64__ -def __SSE__ -def __MMX__ -def __SSE2__ -freeform -vect 48 -output /tmp/pgf90_cV6wu0J1ul.ilm


Technical Problem Report 3983


The MPICH Kit does not set up the slave nodes properly, when installing as root.


Technical Problem Report 3986


% cat semi.f90
module soil_mod

implicit none

type soil_type

integer :: is,ie,js,je; ! computational domain bounds

end type soil_type

end module soil_mod


% pgf90 -V -c semi.f90

pgf90 6.2-4 32-bit target on x86 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGF90/any Linux/x86 6.2-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGF90-S-0310-Illegal statement in the specification part of a MODULE (semi.f90: 7)
0 inform, 0 warnings, 1 severes, 0 fatal for soil_mod


Technical Problem Report 3987


Code causes TERMINATED by Signal 11



% more test.c
#include 
#include 
#include 

void
test(void)
{
int ix;
const int MAX_DEGREE = 10;
double terms[MAX_DEGREE][MAX_DEGREE][MAX_DEGREE];
int termCount = 0;

for(ix = 0; ix < MAX_DEGREE; ix++) {
if(terms[ix][0][0] > 0.0) {
termCount++;
}
}
}


% pgcc -c -V test.c

pgcc 6.2-4 64-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGC/x86-64 Linux/x86-64 6.2-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
pgcc-Fatal-/tmp/pgi624/linux86-64/6.2/bin/pgc TERMINATED by signal 11


Arguments to /tmp/pgi624/linux86-64/6.2/bin/pgc
/tmp/pgi624/linux86-64/6.2/bin/pgc test.c -opt 1 -version -terse 1 -inform warn -x 119 0xa10000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 127 16 -x 19 0x400000 -x 28 0x40000 -quad -x 120 0x80000000 -x 59 4 -x 59 4 -y 80 0x1000 -x 80 0x10800000 -astype 0 -stdinc /tmp/pgi624/linux86-64/6.2/include:/usr/local/include:/usr/lib/gcc/x86_64-redhat-linux/4.1.0/include:/usr/lib/gcc/x86_64-redhat-linux/4.1.0//include:/usr/include -def unix -def __unix -def __unix__ -def linux -def __linux -def __linux__ -def __NO_MATH_INLINES -def __x86_64__ -def __LONG_MAX__=9223372036854775807L -def '__SIZE_TYPE__=unsigned long int' -def '__PTRDIFF_TYPE__=long int' -def __THROW= -def __extension__= -def __amd64__ -def __SSE__ -def __MMX__ -def __SSE2__ -predicate '#machine(x86_64) #lint(off) #system(posix) #cpu(x86_64)' -cmdline '+pgcc test.c -c -V' -x 123 4 -x 123 0x80000000 -alwaysinline /tmp/pgi624/linux86-64/6.2/lib/libintrinsics.il 4 -asm /tmp/pgccx7zgfD

% pgcc -c -V test.c -O2

pgcc 6.2-4 64-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGC/x86-64 Linux/x86-64 6.2-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGC-S-0000-Internal compiler error. chk_du_confl:invalid msize, ili: 40 (test.c: 18)
PGC-S-0000-Internal compiler error. msz_dtype_match:unk msize -1 (test.c: 18)
PGC-S-0000-Internal compiler error. chk_du_confl:invalid msize, ili: 42 (test.c: 18)
PGC-S-0000-Internal compiler error. msz_dtype_match:unk msize -1 (test.c: 18)
PGC-S-0000-Internal compiler error. chk_du_confl:invalid msize, ili: 40 (test.c: 18)
PGC-S-0000-Internal compiler error. chk_du_confl:invalid msize, ili: 42 (test.c: 18)
PGC/x86-64 Linux/x86-64 6.2-4: compilation completed with severe errors

% pgcc -c -V test.c -tp k8-32

pgcc 6.2-4 32-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGC/x86 Linux/x86 6.2-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
/tmp/pgccdzBgjo_V9mkY.s: Assembler messages:
/tmp/pgccdzBgjo_V9mkY.s:45: Error: no such instruction: `mov5 -16(%ebp),'

pgCC does not fail.
Click me