PGI Support


Technical Problem Report 2978


The value passed to the function overflows a char; add -Msignextend as a work-around.

% cat rtest.c
#include 
main () {
        int i;
        int val_diff (char,int);

        i = val_diff (-96, 3232);
        printf ("main: val_diff returns = %d; ", i);
        if (i == 0) {
                printf ("values are the same\n");
        } else {
                printf ("values are different\n");
        }
}

int val_diff(char v, int val)
{
        char c2;
        int iret;
        int foo (char);

#if defined(OK_WAY)
        /*
         * In order to get the cast of val to char to really take hold,
         * we have to do something with it besides just compare.
         * When compiling with -g -O0, just the assignment to c2 is enough;
         * when compiling with default opt, we must also invoke foo().
         */
        c2 = (char) val;
        foo (c2);
        printf ("val_diff: vals are %d and %d\n", v, c2);
        iret = (v != c2);
        return iret;
#elif defined(BAD_WAY)
        printf ("val_diff: vals are %d and %d\n", v, (char) val);
        return (v != (char) val);
#endif
}

int foo (char c) { }

Technical Problem Report 3556


A simple example fails to trigger an fp exception at -O2.

% cat y.c
main()
{
int y=5; int x=0;
printf("y/x = %dn",y/x);
}


% pgcc -o y y.c -V

pgcc 6.0-5a 32-bit target on x86 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGC/x86 Linux/x86 6.0-5a
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
% ./y
Floating exception
% pgcc -O2 -o y y.c -V

pgcc 6.0-5a 32-bit target on x86 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGC/x86 Linux/x86 6.0-5a
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
% ./y
y/x = 0

Technical Problem Report 3620


The following test case shows that compiling with '-O2' will get different results than compiling with -O0, -O1, or -O3.

$ cat bits.c
#include 

main() {
char val[2];
int i = 0;
val[0]='1';
val[1]='';
while(val[0]) {
val[0] <<= 1;
i++;
/* printf("After %d shifts, val is %u (0x%x)n", i,
(unsigned int) val[0], (unsigned int) val[0]); */
}
printf("Bits per byte is %dn", i);
}
$ pgcc -V

pgcc 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.
$ pgcc -o bits -O2 bits.c && ./bits
Bits per byte is 9 <-- Wrong!
$ pgcc -o bits -O0 bits.c && ./bits
Bits per byte is 8
$ pgcc -o bits -O1 bits.c && ./bits
Bits per byte is 8
$ pgcc -o bits -O3 bits.c && ./bits
Bits per byte is 8

Technical Problem Report 3668


A failing case at some optimization levels now works, because -Msignextend is now default in the C compilers, matching the behavior of gcc.


Technical Problem Report 3693


The functions erf and derf return the error function of x. erfc and derfc return 1.0-erf(x) and 1.0- derf(x), respectively. They have been added for the Windows versions of the compilers.

Synopsis
real function erf(x)
real x
real function erfc(x)
real x
double precision function derf(x)
double precision x
double precision function derfc(x)
double precision x

Technical Problem Report 3715


RHEL 4.0 now supports NUMA on Opterons, and we need to integrate that into our installation script.


Technical Problem Report 3741


Users program, when compiled -tp piii -O2 -Mlist -Mbyteswapio, causes compiler to crash.

% pgf90 -O2 -Mlist -Mbyteswapio -tp k8-32 -c vacuum.f

% pgf90 -O2 -Mlist -Mbyteswapio -tp piii -c vacuum.f
PGF90-S-0000-Internal compiler error. flowgraph: node is zero 33 (vacuum.f: 4774)
pgf90-Fatal-/usr/pgi/linux86/6.1/bin/p3/pgf902 TERMINATED by signal 11
Arguments to /usr/pgi/linux86/6.1/bin/p3/pgf902
/usr/pgi/linux86/6.1/bin/p3/pgf902 /tmp/pgf90aaaaallbar.ilm -fn vacuum.f 
-opt 2 -terse 1 -inform warn -x 51 0x20 -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 124 0x1400 -y 15 2 -x 57 0x3b0000 
-x 58 0x48000000 -astype 0 -x 124 1 -x 80 0x300 -y 80 0x1000 
-cmdline '+pgf90 vacuum.f -O2 -Mlist -Mbyteswapio -tp piii -c' 
-asm /tmp/pgf90baaaallbat.s 
% pgf90 -O2 -Mlist -Mbyteswapio -tp p6 -c vacuum.f
PGF90-S-0000-Internal compiler error. flowgraph: node is zero 33 (vacuum.f: 4774)
pgf90-Fatal-/usr/pgi/linux86/6.1/bin/p3/pgf902 TERMINATED by signal 11
Arguments to /usr/pgi/linux86/6.1/bin/p3/pgf902
/usr/pgi/linux86/6.1/bin/p3/pgf902 /tmp/pgf90aaaaaolbah.ilm 
-fn vacuum.f -opt 2 -terse 1 -inform warn -x 51 0x20 -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 124 0x1400 -y 15 2 -x 57 0x3b0000 
-x 58 0x48000000 -astype 0 -x 124 1 -x 80 0x300 -y 80 0x1000 
-cmdline '+pgf90 vacuum.f -O2 -Mlist -Mbyteswapio -tp p6 -c' 
-asm /tmp/pgf90baaaaolbai.s

Technical Problem Report 3743


User noted that a line with an implied DO loop was very slow to compile

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

Technical Problem Report 3757


Dummy Arguments have support as allocatables.

% more ad.f
subroutine ad(a)
real,dimension(:),allocatable :: a

if (allocated(a)) deallocate(a)
allocate(a(100))
end 
% pgf90 -V -c ad.f

pgf90 6.2-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.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
PGF90-S-0198-Illegal use of a in ALLOCATE/DEALLOCATE (ad.f: 4)
PGF90-S-0084-Illegal use of symbol a - must be an allocatable array (ad.f: 5)
  0 inform,   0 warnings,   2 severes, 0 fatal for ad
% settmp704
% pgf90 -V -c ad.f

pgf90 7.0-4 32-bit target on x86 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86 Linux 7.0-4
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86 Linux 7.0-4
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.


Technical Problem Report 3768


The following code ran much better with manual interchange of the loops. Now the compiler matches the performance by manual interchange.

program tbnd
parameter (N=1000)
parameter (M=1000)
parameter (kbndwd= 9)
parameter (lbndwd=1+2*kbndwd)
real A(lbndwd,N)
real B(N)
c
do k = 1, 10000
do j=1,N
do i=1,lnbndwd
A(i,j) = 1.0
end do
A(kbndwd+1,j) = 100.0
B(j) = 2.0
end do
call bnd_LU_09(N,M,A,B)
end do
c
print *,"B(1) = ",B(1)
print *,"B(1000) = ",B(1000)
c
end
c
subroutine bnd_LU_09
& ( N , M ,
& A , b )
parameter (kbndwd= 9)
parameter (lbndwd=1+2*kbndwd)
real A(lbndwd,N)
real B(N)

do k=1,N-kbndwd
oAkk=1./A(kbndwd+1,k)
do i=1,kbndwd,1
A(i,k+kbndwd-i+1)=A(i,k+kbndwd-i+1)*oAkk
enddo
do j=1,kbndwd
do i=1,kbndwd
A(i+j,k+kbndwd-i+1)=A(i+j,k+kbndwd-i+1)
& -A(i,k+kbndwd-i+1)*A(kbndwd+1+j,k)
enddo
enddo
enddo
do k=N-kbndwd+1,N-1
oAkk=1./A(kbndwd+1,k)
do i=k+1,min(k+kbndwd,n)
A(k+kbndwd-i+1,i)=A(k+kbndwd-i+1,i)*oAkk
do j=1,kbndwd
A(k+kbndwd-i+1+j,i)=A(k+kbndwd-i+1+j,i)
& -A(k+kbndwd-i+1,i)*A(kbndwd+1+j,k)
enddo
enddo
enddo
do j=1,N-kbndwd
bj=B(j)
do mi=1,kbndwd
B(j+mi)=B(j+mi)-A(kbndwd-mi+1,j+mi)*bj
enddo
enddo
do j=N-kbndwd+1,N-1
do i=j+1,n
B(i)=B(i)-A(j+kbndwd-i+1,i)*B(j)
enddo
enddo
do j=N,kbndwd+1,-1
B(j)=B(j)/A(kbndwd+1,j)
bj=B(j)
do i=1,kbndwd
B(j-kbndwd+i-1)=B(j-kbndwd+i-1)
& -A(lbndwd-i+1,j-kbndwd+i-1)*Bj
enddo
enddo
do j=kbndwd,2,-1
B(j)=B(j)/A(kbndwd+1,j)
do i=1,j-1,1
B(i)=B(i)-A(j-i+kbndwd+1,i)*B(j)
enddo
enddo
B(1)=B(1)/A(kbndwd+1,1)
return
end

Technical Problem Report 3795


Users example caused ICE.

% pgf90 -fastsse opt.f -tp p6 -c
PGF90-S-0000-Internal compiler error. fr_free: rg already free or wrong owner 1 (opt.f: 4872)
PGF90-S-0000-Internal compiler error. stack87pos: reg not found 1 (opt.f: 4907)
..
..
and so on..
0 inform, 0 warnings, 22 severes, 0 fatal for gqtst

Technical Problem Report 3799


Users with parallel processes that generated scratch files found that the naming scheme we used sometimes resulted in two processes having the same scratch file name. The scheme has been modified to produce unique filenames even in these instances.


Technical Problem Report 3802


We now support -dM to display predefined Macros that have been encountered during preprocessing.

for example, 

$ pgcc -dM -dI 1619.c
#define unix 1
#define __unix 1
#define __unix__ 1
#define linux 1
#define __linux 1
#define __linux__ 1
#define __NO_MATH_INLINES 1
#define __x86_64__ 1
#define __LONG_MAX__ 9223372036854775807L
#define __SIZE_TYPE__ unsigned long int
#define __PTRDIFF_TYPE__ long int
#define __amd64__ 1
#define __SSE__ 1
#define __MMX__ 1
#define __SSE2__ 1
#define __PGI 1
#define __LINE__ 0
#define __FILE__ 1
#define __DATE__ "Nov 8 2006"
#define __TIME__ "14:31:35"
#define __STDC__ 1
#define __STDC_VERSION__ 199901L
#define __PGIC__ 99
#define __PGIC_MINOR__ 99
#define __PGIC_PATCHLEVEL__ 99

Technical Problem Report 3805


The C99 standard defines a Macro __STDC_VERSION__. This has been implemented.

C9X.pdf Section 6.10.8 page 158.
"__STDC_VERSION__" is a decimal constant "199901L".

Technical Problem Report 3869


We have now implemented a switch that provides the predefines the compiler uses. pgcc -dM or pgcc -dD or pgcc -dN or pgcc -dl

% pgcc -dM -V hello.c

pgcc 7.0-1 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 7.0-1
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
#define unix   1
#define __unix   1
#define __unix__   1
#define linux   1
#define __linux   1
#define __linux__   1
#define i386   1
#define __i386   1
#define __i386__   1
#define __NO_MATH_INLINES   1
#define linux86   1
#define __SSE__   1
#define __MMX__   1
#define __SSE2__   1
#define __SSE3__   1
#define __PGI  1
#define __LINE__  0
#define __FILE__  1
#define __DATE__  "Dec 15 2006"
#define __TIME__  "16:18:29"
#define __STDC__  1
#define __STDC_VERSION__  199901L
#define __PGIC__  7
#define __PGIC_MINOR__  0
#define __PGIC_PATCHLEVEL__  1

// /usr/include/stdio.h:27
#define _STDIO_H   1

// /usr/include/features.h:20
#define _FEATURES_H   1

// /usr/include/features.h:90
#undef __USE_ISOC99
#undef __USE_POSIX
#undef __USE_POSIX2
#undef __USE_POSIX199309
#undef __USE_POSIX199506
#undef __USE_XOPEN
#undef __USE_XOPEN_EXTENDED
#undef __USE_UNIX98
#undef __USE_XOPEN2K
#undef __USE_LARGEFILE
#undef __USE_LARGEFILE64
#undef __USE_FILE_OFFSET64
#undef __USE_BSD
#undef __USE_SVID
#undef __USE_MISC
#undef __USE_GNU
#undef __USE_REENTRANT
#undef __USE_FORTIFY_LEVEL
#undef __FAVOR_BSD
#undef __KERNEL_STRICT_NAMES

// /usr/include/features.h:118
#define __USE_ANSI   1

// /usr/include/features.h:131
#define __GNUC_PREREQ(maj,min)   0

// /usr/include/features.h:169
#define _BSD_SOURCE   1
#define _SVID_SOURCE   1

// /usr/include/features.h:179
#define __USE_ISOC99   1

// /usr/include/features.h:186
#define _POSIX_SOURCE   1

// /usr/include/features.h:190
#define _POSIX_C_SOURCE   199506L

// /usr/include/features.h:195
#define __USE_POSIX   1

// /usr/include/features.h:199
#define __USE_POSIX2   1

// /usr/include/features.h:203
#define __USE_POSIX199309   1

// /usr/include/features.h:207
#define __USE_POSIX199506   1

// /usr/include/features.h:246
#define __USE_MISC   1

// /usr/include/features.h:250
#define __USE_BSD   1

// /usr/include/features.h:254
#define __USE_SVID   1

// /usr/include/features.h:274
#define __STDC_IEC_559__   1
#define __STDC_IEC_559_COMPLEX__   1

// /usr/include/features.h:278
#define __STDC_ISO_10646__   200009L

// /usr/include/features.h:286
#undef __GNU_LIBRARY__
#define __GNU_LIBRARY__   6

// /usr/include/features.h:291
#define __GLIBC__   2
#define __GLIBC_MINOR__   3
...
..
.............and so on.

Technical Problem Report 3874


C++ code fails to print 'long double' data type using cout

% cat x.C
#include 

int main()
{
using namespace std;
double biggy = 1.0e307;
cout << biggy << endl;
return 0;
}
% pgCC x.C

% ./a.out
Code:
1e+307


When I change
Code:
double
to
Code:
long double

then the output is
Code:
0
(or sometimes a "-" or nothing at all)

g++ seems to do it correct both times.

Technical Problem Report 3888


It was determined that the behavior of the exception switches -Ktrap=fp, -Kfptrap, -Knoieee and -Knofptrap did not match the documentation. Also, the documentation should indicate that the main program only can be compiled with these switches, or the registers being loaded will not be.


Technical Problem Report 3892


The following user's code fails because the prototype for the C99 functions fmax and fmin are not used since they guarded in the linux bits/mathcalls.h by GNU define flags. Now the same result with -DNEED_C99_PROTO as without it.

cat test.c

#include 
#include 
#include 

#ifdef NEED_C99_PROTO
double fmax(double, double);
double fmin(double, double);
#endif

int main(void) {
double k =0.0e0, l=100.0e0;
double mx = fmax(k,l);
double mn = fmin(k,l);

printf("%15.6E\n",fmin(k,l));
printf("%15.6f\n",mn);
printf("%15.6f\n",mx);
printf("%15.6E\n",fmax(k,l));

return 0;
}



Technical Problem Report 3899


User encountered an "out of bounds" error when running after compiling with "-C". But allocating an array with size 0 should not trigger such an error message. In addition, this seems to happen only in combination with a character array.

program alloc
implicit none
integer :: n
character(len=10), dimension(:),pointer :: val1

call machet(val1)
write(*,*) 'val1: size,len',size(val1),len(val1(1))

contains
subroutine machet(value)

integer :: status
integer :: n
character(len=*), dimension(:), pointer :: value
integer, dimension(:), pointer :: ival

n = 0
allocate(ival(n), stat=status)
if (status >0) then
write(*,*) ' error 1'
end if

allocate(value(n), stat=status)
if (status >0) then
write(*,*) ' error 2'
end if

end subroutine machet
end program alloc


Compiled with pgf90 -C alloc.f90 and run gives:
0: Subscript out of range for array value (alloc.f90: 23)
subscript=1, lower bound=1, upper bound=0, dimension=1


Technical Problem Report 3900


The thread limit on an OpenMP library, even when compiled with a SERVER license will always take on the limit that the main() routine aquires when it is compiled by the library user. The limit used to be 4 sockets; it is now 8 sockets.


Technical Problem Report 3904


Our install script, makelocalrc needs to be French-aware, along with other languages.


Technical Problem Report 3908


The front-end does not attempt to collapse an implied I/O do item when -Mlarge_arrays/-mcmodel=medium is used. This causes a serious performance drop.

1) with mcmodel=small
> pgf77 test.f
> time a.out
check start!
check completed!
FORTRAN STOP

real 0m0.008s <----
user 0m0.004s
sys 0m0.000s

(2) with mcmodel=medium
> pgf77 -mcmodel=medium test.f
> time a.out
check start!
check completed!
FORTRAN STOP

real 0m0.150s <----
user 0m0.144s <---- too slow.
sys 0m0.008s

Technical Problem Report 3911


-Mchkptr causes an error during execution, probably because associated(x) is treated like a dereference of x.

% cat test.f90
program nullptr
implicit none
integer, dimension(:), pointer :: itar, iptr
nullify (itar)
iptr => itar
if (associated(itar)) then
print *, "itar ASSOCIATED"
else
print *, "itar UNASSOCIATED"
end if
if (associated(iptr)) then
print *, "iptr ASSOCIATED"
else
print *, "iptr UNASSOCIATED"
end if
end program nullptr

% pgf90 -Mchkptr test.f90

% ./a.out
0: Null pointer for itar (test.f90: 5)

Technical Problem Report 3916


Documentation of the Routine setvbuf3f

Fortran I/O uses 3 types of buffering, unbuffered, line buffered, and fully buffered. Units 5 (stdin) and 6 (stdout) are line buffered. Unit 0 (stderr) is unbuffered. Disk files are fully buffered. These are generally the correct choices. You can use setvbuf3f to change a unit's buffering type and size of the buffer.

This function must be called after the unit is opened and before any I/O is done on the unit.

The typ parameter can have the following values, 0 specifies full buffering, 1 specifies line buffering, and 2 specifies unbuffered. The size parameter specifies the size of the buffer. Note: the underlying stdio implementation may silently restrict your choice of buffer size.

This function will return zero on success and non-zero on failure.

An example of where this function might be useful would be a long-running program that writes a small amount of data to a log file. If the log file is line buffered, you could check the log file for progress. If the log file were fully buffered, the data may not be written to disk until the program terminates.

INTERFACE
 INTEGER FUNCTION setvbuf3f(lu,typ,size)
 INTEGER lu,typ,size
 END FUNCTION
END INTERFACE

Technical Problem Report 3919


A Fortran example missed an opportunity to hoist costly dsin from loop,

if ( .NOT.(ii.eq.jj-8) ) then
sum = sum + dsin(2.d0*pig)
else
sum = sum - dsin(5.d0*pig)
endif

Technical Problem Report 3922


A number of OpenMP routines are linked into programs by default, whether or not the code is compiled -mp. This has been corrected.


Technical Problem Report 3925


An implied do loop causes the compiler to falsely report a severe error.

program test2
implicit none

integer :: i
integer, parameter :: nn=12

real, dimension(nn), parameter :: Alt1 = (/(3*i, i=1,nn)/)
real, dimension(nn), parameter :: Alt2 = (/(3.0*i, i=1,nn)/)

print*, "Hello World!", Alt1(11), Alt2(11)

end program test2

% pgf90 -o test test.f90 -V

pgf90 6.2-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.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
PGF90-S-0069-Illegal implied DO expression (test.f90: 8)
PGF90-S-0069-Illegal implied DO expression (test.f90: 8)
PGF90-S-0069-Illegal implied DO expression (test.f90: 8)
PGF90-S-0069-Illegal implied DO expression (test.f90: 8)
PGF90-S-0069-Illegal implied DO expression (test.f90: 8)
PGF90-S-0069-Illegal implied DO expression (test.f90: 8)
PGF90-S-0069-Illegal implied DO expression (test.f90: 8)
PGF90-S-0069-Illegal implied DO expression (test.f90: 8)
PGF90-S-0069-Illegal implied DO expression (test.f90: 8)
PGF90-S-0069-Illegal implied DO expression (test.f90: 8)
PGF90-S-0069-Illegal implied DO expression (test.f90: 8)
PGF90-S-0069-Illegal implied DO expression (test.f90: 8)
  0 inform,   0 warnings,  12 severes, 0 fatal for test2
% pgf90 -o test test.f90 -V

pgf90 7.0-2a 32-bit target on x86 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86 Linux 7.0-2a
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86 Linux 7.0-2a
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.


Technical Problem Report 3923


Loop bounds that passed in a structure , and stored locally, aren't countable.

#include 

typedef struct {
int is; // Start of i-loop
int ie; // End of i-loop
int isdot;
int iedot;
int js;
int je;
int jsdot;
int jedot;
int jstride; // j-stride size
} LoopLimits;

int foo1(double * v, LoopLimits l);
int foo2(double * v, LoopLimits l);

int main() {
LoopLimits a;
double v[500];
int i,j;
a.is = 0;
a.ie = 100;
a.jstride = 100;
for (i = 0; i < 500; i++) {
v[i] = 1.0;
}
j = foo1(v,a);
printf("foo = %dn",j);
j = foo2(v,a);
printf("foo = %dn",j);
}

int foo1(double * v, LoopLimits l) {
LoopLimits b;
double * restrict w = v + l.jstride;

b = l;
printf("Bounds are %d %dn",b.is,b.ie);
for (int i = b.is; i < b.ie; i++) {
v[i] = v[i] + w[i];
}
if (w[0] != v[0]) return 1;
return 0;
}

int foo2(double * v, LoopLimits l) {
LoopLimits b;
double * restrict w = v + l.jstride;
int i,is,ie;

b = l;
is = b.is;
ie = b.ie;
printf("Bounds are %d %dn",is,ie);
for (i = is; i < ie; i++) {
v[i] = v[i] + w[i];
}
if (w[0] != v[0]) return 1;
return 0;
}
> pgcc -fastsse -Minfo=all -Mneginfo=all t.c
foo1:
40, Loop not vectorized: not countable
foo2:
56, Generated 3 alternate loops for the inner loop
Generated vector sse code for inner loop
Generated 2 prefetch instructions for this loop
Generated vector sse code for inner loop
Generated 2 prefetch instructions for this loop
Generated vector sse code for inner loop
Generated 2 prefetch instructions for this loop
Generated vector sse code for inner loop
Generated 2 prefetch instructions for this loop
> ./a.out
Bounds are 0 100
foo = 1
Bounds are 0 100
foo = 1

Technical Problem Report 3930


The routine ICHAR in the initialization is producing wrong results.

$ cat test.f90
integer(8) :: actg(0:3) = (/ichar('a'),ichar('c'),ichar('t'),ichar('g')/)
write(*,'(1x,4i4)') actg
actg(0) = ichar('a')
actg(1) = ichar('c')
actg(2) = ichar('t')
actg(3) = ichar('g')
write(*,'(1x,4i4)') actg
end


% pgf90 -o test test.f90 -V

pgf90 6.2-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.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86 Linux/x86 6.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
% ./test
   97  97  97  97   <-----------------------wrong
   97  99 116 103

% pgf90 -o test test.f90 -V

pgf90 7.0-2a 32-bit target on x86 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86 Linux 7.0-2a
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86 Linux 7.0-2a
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.

% ./test
   97  99 116 103
   97  99 116 103

Technical Problem Report 3940


The test case shows a memory leak in the new allocatable components feature of pgi 6.2-2. In the assignment statement:
duplicate = Vector_(vector_length)
the function reference returns a user-defined type with an allocatable component, and the variable duplicate is of the same type. The function Vector_ contains an allocation of the component
ALLOCATE(this%component(num_elements))
which appears in the assembly listing as
call pgf90_alloc
However, in the main program there is no corresponding deallocation of the current component of duplicate before the function Vector_ is called. As a result the memory image for the program grows with each loop iteration.


Technical Problem Report 3945


We added large array coding considerations to the user guidea.


Technical Problem Report 3946


User's code failed with an internal compiler error (ICE).

% pgf90 -i4 -tp x64 -fastsse -Mnosecond_underscore -Mlarge_arrays -mp -fpic cadari.for -c
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-S-0000-Internal compiler error. flowgraph: node is zero     175 (cadari.for: 1221)
PGF90-F-0008-Error limit exceeded (cadari.for: 1221)
PGF90/x86 Linux/x86-64 6.2-5: compilation aborted




% pgf90 -i4 -tp x64 -fastsse -Mnosecond_underscore -Mlarge_arrays -mp -fpic cadari.for -c -V

pgf90 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.


Technical Problem Report 3947


This test case was extracted from the NIMROD application at ORNL. This has been corrected.

% pgf90 -c modu.f test.f -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.
modu.f:
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.
test.f:
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.
Lowering Error: pointer symbol seam_out$p is a member reference
PGF90-F-0000-Internal compiler error. Errors in Lowering 1 (test.f: 41)
PGF90/any Linux/x86 6.2-3: compilation aborted


Technical Problem Report 3955


pgcc cannot compile/preprocess files ending in .h. This has been corrected.


Technical Problem Report 3965


User pointed out that we were missing an optimization opportunity.

Code like this 

subroutine rtest (n, x, y)
real x(n)
do i = 1, n
y = y + x(i)
end do
end

optimizes better when written as

subroutine rtest(n,x,y)
real x(n),t
t = y
do i=1,n
t = t + x(i)
end do
y = t
end

We now take advantage of the opportunity.


Technical Problem Report 3969


When a user links the ACML library with Visual C++ an undefined reference to __builtin_stinit is created. This has been corrected.


Technical Problem Report 3971


This information is missng from the Fortran Ref Manual. - All fortran languages (pgf77, pgf90, pghpf) now support an OPEN statement specifier which allows for byte-swapping I/O to be performed on specific logical units. Previously, byte-swapping I/O was only enabled by the command-line option, -byteswapio, and was applied to all unformatted I/O operations which appeared in the files compiled -byteswapio.

The new OPEN specifier is CONVERT=char expr where char expr is one of - 'BIG_ENDIAN', - 'LITTLE_ENDIAN', or - 'NATIVE'.

The value 'BIG_ENDIAN' is used to convert big-endian format data files produced by most RISC workstations and high-end servers to the little-endian format used on Intel Architecture systems on-the-fly during file reads/writes. This value assumes that the record layouts of unformatted sequential access and direct access files are the same on the systems.

For the values 'LITTLE_ENDIAN' and 'NATIVE", byte-swapping is not performed during file reads/writes since the little-endian format is used on Intel Architecture.

- All fortran (pgf77, pgf90, pghpf) now support a new value, 'BINARY', to the FORM specifier in the OPEN statement which allows for binary unformatted I/O to be performed on specific logical units. For an unformatted file whose form is 'BINARY', the file is just viewed as a byte-stream file, such as a file created by fwrite() calls in a C program; the data in the file is not organized into records.


Technical Problem Report 3972


DWARF format debug information in C and C++ was defective. This has been corrected.


Technical Problem Report 3975


User's example causes the compiler to generate Assembler error messages.

pgf90 -c -r8 -fast test.f -tp k8-64
/tmp/pgf90i67hyCA5WwgY.s: Assembler messages:
/tmp/pgf90i67hyCA5WwgY.s:370: Error: suffix or operands invalid for `movsd'
/tmp/pgf90i67hyCA5WwgY.s:390: Error: suffix or operands invalid for `movsd'
/tmp/pgf90i67hyCA5WwgY.s:440: Error: suffix or operands invalid for `movsd'
/tmp/pgf90i67hyCA5WwgY.s:654: Error: suffix or operands invalid for `movsd'
/tmp/pgf90i67hyCA5WwgY.s:674: Error: suffix or operands invalid for `movsd'
/tmp/pgf90i67hyCA5WwgY.s:723: Error: suffix or operands invalid for `movsd'


Technical Problem Report 3977


The following example should report an error when -Mstandard is used.

% cat test.f90
real a(:)

allocate(a(100),stat=i)
print *, i

end

with 6.2-5, no errors 
% pgf90 -Mstandard -c test.f90 -V

pgf90 6.2-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.2-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.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.


with 7.0-2
% pgf90 -Mstandard -c test.f90 -V

pgf90 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90-S-0084-Illegal use of symbol a - must be an allocatable array (test.f90: 3)
  0 inform,   0 warnings,   1 severes, 0 fatal for MAIN

Technical Problem Report 3980


User's program caused the compiler to be TERMINATED by signal 11

% pgf90 -V

pgf90 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.
pgf90 -I. -c -o atomsettype.o atomsettype.f
pgf90 -I. -c -o forces.o forces.f
pgf90 -I. -c -o gear.o gear.f
pgf90 -I. -c -o disloc.o disloc.f
pgf90-Fatal-/tmp/pgi624/linux86/6.2/bin/newcg/pgf901 TERMINATED by signal 11
Arguments to /tmp/pgi624/linux86/6.2/bin/newcg/pgf901
/tmp/pgi624/linux86/6.2/bin/newcg/pgf901 disloc.f -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/pgi624/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__ -idir . -nofreeform -vect 48 -output /tmp/pgf90Bmefr1blk-v1.ilm
make: *** [disloc.o] Error 127

Technical Problem Report 3982


Multiple source files in multiple directories are compiled, each with a different version of a modfile that is named the same. This confusesd the 6.2 compiler. Now it will act to look first in the directory where the compiled file is for the modfile needed.


Technical Problem Report 3985


In order to support user defined options, we added PREOPTIONS and POSTOPTIONS and -nodefaultoptions

append PREOPTIONS=-DTESTPREOPTIONS;
append POSTOPTIONS=-DTESTPOSTOPTIONS;

pgcc -v -O2 -V7.0-1 -c /opt/QA/tests/art/src/scanner.c

/usr/pgi/linux86-64/7.0-1/bin/pgc /opt/QA/tests/art/src/scanner.c -opt 2 -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 
/usr/pgi/linux86-64/7.0-1/include:/usr/local/include:/usr/lib64/gcc/x86_64-suse-linux/4.0.2/include:
/usr/lib64/gcc/x86_64-suse-linux/4.0.2//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__ -def __SSE3__ -predicate '#machine(x86_64) 
#lint(off) #system(posix) #cpu(x86_64)' -def TESTPREOPTIONS -def TESTPOSTOPTIONS 
-cmdline '+pgcc /opt/QA/tests/art/src/scanner.c -DTESTPREOPTIONS -v -O2 -V7.0-1 -c 
-DTESTPOSTOPTIONS' -x 123 4 -x 123 0x80000000 -alwaysinline 
/usr/pgi/linux86-64/7.0-1/lib/libintrinsics.il 4 -asm /tmp/pgccQOCg_V3qeHpY.s

Technical Problem Report 3988


User thinks the four subroutines below should all vectorize.

subroutine vmax(a,b,c,n,t1,t2)
real(8) a(n,n), b(n,n),c(n,n)
integer(8) n,t1(*),t2(*)

do j=1,n
do i=max(1,t1(j)),min(n,t2(j))
a(i,j)=max(b(i,j),c(i,j))
enddo
enddo

end

subroutine vmax1(a,b,c,n,t1,t2)
real(8) a(n,n), b(n,n),c(n,n)
integer(8) n,t1,t2

do j=1,n
do i=t1,t2
a(i,j)=max(b(i,j),c(i,j))
enddo
enddo

end

subroutine vmax2(a,b,c,n,m)
real(8) a(m,n), b(m,n),c(m,n)
integer(8) n,m

do j=1,n
do i=1,m
a(i,j)=max(b(i,j),c(i,j))
enddo
enddo

end

subroutine vmax3(a,b,c,n,m)
real(8) a(m,n), b(m,n),c(m,n)
integer(8) n,m

do j=1,n
do i=2,m
a(i,j)=max(b(i,j),c(i,j))
enddo
enddo

% pgf90 -c -Minfo -fastsse -Mfprelaxed test.f90 -V

pgf90 6.2-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.2-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.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
vmax:
     6, Loop unrolled 4 times
vmax1:
    18, Generated 4 alternate loops for the inner loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
vmax2:
    30, Generated 4 alternate loops for the inner loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
vmax3:
    42, Generated 4 alternate loops for the inner loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop

with the 7.0 compilers
----------------------

% pgf90 -c -Minfo -fastsse -Mfprelaxed test.f90 -V

pgf90 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
vmax:
     6, Generated 4 alternate loops for the inner loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
vmax1:
    18, Generated 4 alternate loops for the inner loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
vmax2:
    30, Generated 4 alternate loops for the inner loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
vmax3:
    42, Generated 4 alternate loops for the inner loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop
        Generated vector sse code for inner loop
        Generated 2 prefetch instructions for this loop

Technical Problem Report 3990


User code seg faults when using a passed procedure in an internal function. The code compiled with 6.2-5, but failed during execution when encountering a call to a passed in function from an internal subroutine.


Technical Problem Report 3991


The SAVE attribute was not being implemented when -Msave was not also set. This has been corrected.


Technical Problem Report 3992


DIM argument to minval and maxval is broken

% cat test.f90
program test_minval

  implicit none

  integer :: i
  real(kind=8), dimension(3,4) :: a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 /) , (/ 3,4 /) )
  real(kind=8) :: minmaxv(3,2,4)

  print*,"a="
  write(6,'(3f10.2)') (a(i,1),i=1,3)
  write(6,'(3f10.2)') (a(i,2),i=1,3)
  write(6,'(3f10.2)') (a(i,3),i=1,3)
  write(6,'(3f10.2)') (a(i,4),i=1,3)

  minmaxv(:,1,1) = minval(a,DIM=2)
  minmaxv(:,2,1) = maxval(a,DIM=2)

  print*,""
  print*,"minval="
  write(6,'(3f10.2)') minmaxv(:,1,1)
  print*,""
  print*,"maxval="
  write(6,'(3f10.2)') minmaxv(:,2,1)
  print*,""

end program test_minval

% pgf90 -V test.f90

pgf90 6.2-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.2-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.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
% ./a.out
 a=
      1.00      2.00      3.00
      4.00      5.00      6.00
      7.00      8.00      9.00
     10.00     11.00     12.00
 
 minval=
     10.00     10.00     10.00  <---------------------------wrong
 
 maxval=
     10.00     10.00     10.00  <---------------------------wrong



% pgf90 -V test.f90

pgf90 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
% ./a.out
 a=
      1.00      2.00      3.00
      4.00      5.00      6.00
      7.00      8.00      9.00
     10.00     11.00     12.00
 
 minval=
      1.00      2.00      3.00
 
 maxval=
     10.00     11.00     12.00

Technical Problem Report 3993


Program fails when compiled with -Mchkptr.

% cat test.f90
        program test
        type data_set
            integer , pointer :: ld(:,:) => null()
            character(72) , pointer :: cd(:,:) => null()
        end type data_set

        type(data_set), pointer :: p1
        type(data_set), target :: td
        character(72), target :: c1(5,6)

        p1 => td
!        p1%cd => c1

        if (associated(p1%ld)) then
            write(*,*) 'ld Yes'
        else
            write(*,*) 'ld No'
        end if

        if (associated(p1%cd)) then
            write(*,*) 'cd Yes'
        else
            write(*,*) 'cd No'
        end if

        end

% pgf90 -V -o test test.f90 -Mchkptr -tp k8-64

pgf90 6.2-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.2-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.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
% ./test
 ld No
0: Null pointer for p1%cd (test.f90: 20)  <--------------wrong

% pgf90 -V -o test test.f90 -Mchkptr -tp k8-64

pgf90 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
% ./test
 ld No
 cd No              <-------------------------------correct

Technical Problem Report 3995


Program gets wrong answers when a section is vectorized. A directive to turn off the vectorizer causes the answers to differ.

% diff test.f test1.f
102d101
< cpgi$ novector
% pgf90 -fastsse -byteswapio -o test test.f -V

pgf90 6.2-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.2-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.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.

% pgf90 -fastsse -byteswapio -o test1 test1.f -V

pgf90 6.2-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.2-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.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.

% ./test
  l, jd, kd, ld=            2           21           15           15
  stuff diag(1,1,9)=    0.000000000000000     
  stuff h(1,1)=   3.0798156208940841E-020
  stuff h(1,2)=   3.0798156208940841E-020
FORTRAN STOP
% ./test1
  l, jd, kd, ld=            2           21           15           15
  stuff diag(1,1,9)=    0.000000000000000     
  stuff h(1,1)=   -2.584640104061622  <--------------------wrong     
  stuff h(1,2)=   -2.584640104061622  <--------------------wrong


% pgf90 -fastsse -byteswapio -o test test.f -V

pgf90 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.

% pgf90 -fastsse -byteswapio -o test1 test1.f -V

pgf90 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
% ./test
  l, jd, kd, ld=            2           21           15           15
  stuff diag(1,1,9)=    0.000000000000000     
  stuff h(1,1)=   3.0798156208940841E-020
  stuff h(1,2)=   3.0798156208940841E-020
FORTRAN STOP
% ./test1
  l, jd, kd, ld=            2           21           15           15
  stuff diag(1,1,9)=    0.000000000000000     
  stuff h(1,1)=   3.0798156208940841E-020
  stuff h(1,2)=   3.0798156208940841E-020
FORTRAN STOP

Technical Problem Report 3997


A program produces wrong answers at higher opt levels

% cat test1.f90
module z
  real,dimension(:),allocatable :: b
end module z
subroutine subA
  use z
  implicit none
  b=76.1
end subroutine subA
subroutine x(a,n)
  use z
  implicit none
  integer,intent(in) :: n
  real,dimension(n) :: a
  allocate(b(n))
  b(1:n) = a(1:n)
  call subA
  a(1:n) = b(1:n)
  print *, "a=",a(1:n)
  print *, "b=",b(1:n)
end subroutine x
program pgi_opt_bug
  implicit none
  real,dimension(:),allocatable :: array
  integer :: array_size
  array_size=5
  allocate(array(array_size))
  array=1.0
  call x(array,array_size)
end program pgi_opt_bug

% pgf90 -V

pgf90 6.2-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 -O0 -o test1_0 test1.f90
% pgf90 -O1 -o test1_1 test1.f90
% pgf90 -fast -o test1_fast test1.f90
% ./test1_0
 a=    76.10000        76.10000        76.10000        76.10000     
    76.10000    
 b=    76.10000        76.10000        76.10000        76.10000     
    76.10000    
% ./test1_1
 a=    76.10000        76.10000        76.10000        76.10000     
    76.10000    
 b=    76.10000        76.10000        76.10000        76.10000     
    76.10000    
% ./test1_fast
 a=    1.000000        1.000000        1.000000        1.000000     
    1.000000    
 b=    76.10000        76.10000        76.10000        76.10000     
    76.10000

% pgf90 -V

pgf90 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.

% pgf90 -O0 -o test1_0 test1.f90
% pgf90 -O1 -o test1_1 test1.f90
% pgf90 -fast -o test1_fast test1.f90
% ./test1_0
 a=    76.10000        76.10000        76.10000        76.10000     
    76.10000    
 b=    76.10000        76.10000        76.10000        76.10000     
    76.10000    
% ./test1_1
 a=    76.10000        76.10000        76.10000        76.10000     
    76.10000    
 b=    76.10000        76.10000        76.10000        76.10000     
    76.10000    
% ./test1_fast
 a=    76.10000        76.10000        76.10000        76.10000     
    76.10000    
 b=    76.10000        76.10000        76.10000        76.10000     
    76.10000

Technical Problem Report 3998


Program compiled -g did not link properly. Corrected in 7.0.

% cat test.f90 
program DoesNothing
use MyMod
end program DoesNothing 
% cat mod.f90
      module MyMod

      contains
      subroutine ModuleRoutine
      integer, allocatable,save :: iAllocSave(:)
      end subroutine ModuleRoutine

      end module MyMod

% pgf90 -c mod.f90 -g
% pgf90 -o test test.f90 -g -V mod.o

pgf90 6.2-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.
test.f90:
PGF90/any Linux/x86-64 6.2-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.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
mod.o: In function `..Dm_mymod':mod.f90:(.debug_info+0x8a): undefined reference to `.BSS2'
:mod.f90:(.debug_info+0xa2): undefined reference to `.BSS2'
:mod.f90:(.debug_info+0xae): undefined reference to `.BSS2'
:mod.f90:(.debug_info+0xba): undefined reference to `.BSS2



Technical Problem Report 4000


User who declares $TMPDIR as a directory that does not exist, causes the compiler to hang. This has been corrected.


Technical Problem Report 4003


The program is clearly defective, but the compiler should not abort, but rather print useful messages.

% cat test.f90
real cspl,unk
logical derg

derg = 0.0
cspl=1.
unk=2.0
derg = derg + cspl
unk = unk + derg
end
% pgf90 -r8 test.f90
Lowering Error: unknown source type for conversion to double precision [ast=11,asttype=1,datatype=16]
Lowering Error: unknown source type for conversion to double precision [ast=11,asttype=1,datatype=16]
PGF90-F-0000-Internal compiler error. Errors in Lowering 2 (test.f90: 9)
PGF90/any Linux/x86-64 6.2-5: compilation aborted

Technical Problem Report 4005


User example seg faults with pgcc, but not other C compilers.

% cat bugs.c
#include 

const int N = 2;

static void func(int i)
{
if(i)
return;
double arr[N];
}

int main()
{
printf("firstn");
func(0);
printf("secondn");
func(1);
printf("OKn");
return 0;
}


% pgcc -o bug2 bug2.c -V

pgcc 6.2-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.
PGC/x86-64 Linux/x86-64 6.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
% ./bug2
Segmentation fault

% pgcc -o bug2 bug2.c -V

pgcc 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGC/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
% ./bug2
firstnsecondnOKn

Technical Problem Report 4006


User gets a an error from legal code when compiled. It has been corrected.


Technical Problem Report 4007


The Installation instructions about where to put lmgrd so that it will auto-start after reboot indicate directories like /etc/rc.d/init.d and on systems like SUSE 10 , /etc/rc.d and /etc/init.d are on the same level. It looks like linux has been transitoning where these directories are located, and on some systems, links have been created to simulate the old structures. But not all of them. The notes have been updated.


Technical Problem Report 4008


User's code fails with pgf77 -Minline , and Terminates. This has been corrected.

% pgf77 -c -Minline test_pgi.f -V

pgf77 6.2-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.
PGFTN/x86-64 Linux/x86-64 6.2-5
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-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
pgf77-Fatal-/tmp/pgi625/linux86-64/6.2/bin/pgftn TERMINATED by signal 11
....

% pgf77 -c -Minline test_pgi.f -V

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

Technical Problem Report 4009


User code executes with a segfault.

% cat len.f90
program testlen

implicit none

character (len=10) :: b = ''

call sub1(b)

write(*,*) 'b is =',b, 'ENDOFSTR'

contains

subroutine sub1 (dset_scalar)
  character(len=*), intent(out) :: dset_scalar

  character(len=len(dset_scalar)), dimension(:), pointer    :: dset
  integer :: dim1 = 3
  integer :: i
  integer :: mem_status = 0

  allocate(dset(dim1), stat=mem_status)
  if (mem_status /= 0) then
    stop 'allocate failed'
  end if

  do i = 1, dim1
    write(*,*) '1 len = ',len(dset(i))
    call sub2(dset,dim1)
  end do

  dset_scalar = dset(1)

end subroutine sub1

subroutine sub2(dset,dim1)
  integer, intent(in) :: dim1
  character(len=*), dimension(dim1) , intent(inout)     :: dset

  write(*,*) '2 len(dset) =',len(dset(1)),len(dset(2)),len(dset(3))
  call date_and_time(dset(1),dset(2),dset(3))

end subroutine sub2

end program testlen

% pgf90 -V

pgf90 6.2-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 -o len_625 len.f90

% pgf90 -V

pgf90 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
% pgf90 -o len_702 len.f90
% ./len_625
 1 len =            10
 2 len(dset) =            0            0            0
 1 len =            10
 2 len(dset) =            0            0            0
 1 len =            10
 2 len(dset) =            0            0            0
Segmentation fault

% ./len_702
 1 len =            10
 2 len(dset) =           10           10           10
 1 len =            10
 2 len(dset) =           10           10           10
 1 len =            10
 2 len(dset) =           10           10           10
 b is =20070227  ENDOFSTR

Technical Problem Report 4010


Typo in documentation. Was --use_pch, should be --use_dir


Technical Problem Report 4012


User code caused an Internal compiler error (ICE). This has been corrected.

% pgf90 -Mpreprocess -byteswapio -c FxcDenConvecAddF.f -Mvect -V

pgf90 6.2-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.2-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.2-5
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
PGF90-F-0000-Internal compiler error. wrong loop indices when computing distances 0 (FxcDenConvecAddF.f: 74)

Technical Problem Report 4011


2.0**66 causes a floating exception with -Ktrap=fp.

% more prob.f
program fpebug
integer ix
real x
ix = 66 ! fails for ix >= 64
x = 2.0**ix
write (6,*) x
end

% pgf77 -Ktrap=fp fpebug.f
% ./a.out
Floating point exception (core dumped)
% pgf77  fpebug.f
% ./a.out
7.3786976E+19

Technical Problem Report 4014


User's example causes compiler to abort.

% pgf90 -c -g params.F -V

pgf90 6.2-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.2-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.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
*** glibc detected *** /tmp/pgi625/linux86-64/6.2/bin/pgf902: corrupted double-linked list: 0x0000000040435d60 ***
2aed7e200000-pgf90-Fatal-/tmp/pgi625/linux86-64/6.2/bin/pgf902 TERMINATED by signal 6

Technical Problem Report 4015


User's program causes ICE in the compiler.

% pgf90 -c p_full.f -V

pgf90 6.2-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.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
Lowering Error: logical result for arithmetic operation [ast=170,asttype=4,datatype=16]
Lowering Error: logical result for arithmetic operation [ast=206,asttype=4,datatype=16]
Lowering Error: logical result for arithmetic operation [ast=208,asttype=4,datatype=16]
Lowering Error: logical result for arithmetic operation [ast=336,asttype=4,datatype=16]
PGF90-F-0000-Internal compiler error. Errors in Lowering       4 (p_full.f: 371)
PGF90/any Linux/x86-64 6.2-5: compilation aborted


% pgf90 -c p_full.f -V

pgf90 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.

Technical Problem Report 4016


Example fails with __attribute__((aligned (16))) in code.

> cat ss.c

#include 

struct sigcontext {
long sc_fpstate[128] __attribute__((aligned (16)));
};

> pgCC -c ss.c
pgCC -c ss.c
PGCC-S-0000-Internal compiler error. unexpected edg alignment %d 16 ()
PGCC/x86 Linux/x86-64 6.2-5: compilation completed with severe errors.

Technical Problem Report 4018


WRF V2.2 Fails to compile. The problem has been corrected.


Technical Problem Report 4019


Setting the environment variable PGI_OBJSUFFIX to o generates object files with a suffix of .o instead of .obj.

In bash, you can type:

PGI$ declare -x PGI_OBJSUFFIX=o
PGI$ pgf90 x.f -o xf
LINK : fatal error LNK1561: entry point must be defined 

Technical Problem Report 4020


User requested renaming of certain libraries for their use.


Technical Problem Report 4021


Code seg faults with 6.2-5.

% cat test.f90
program assume

integer, dimension(-2:2) :: iarr
integer :: i

do i=-2,2
iarr(i) = i
enddo
call my_proc(iarr, lbound(iarr))

contains

subroutine my_proc(iarr, ilow)
integer, dimension(:) :: ilow
integer, dimension(ilow(1):) :: iarr

print *, ilow, lbound(iarr), ubound(iarr)
end subroutine my_proc

end program assume

% pgf90 -V

pgf90 6.2-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 -o test_625 test.f90

% pgf90 -V

pgf90 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
% pgf90 -o test_702 test.f90

% ./test_625
Segmentation fault

% ./test_702
           -2           -2            2

Technical Problem Report 4022


An FAQ webpage, gives information about how to run Windows executables developed with PGI compilers on a Windows system that does not have the PGI compilers installed.


Technical Problem Report 4024


Example created an ICE when compiled with 6.2-5 or earlier pgf90.

% cat test.f90
Subroutine CalcVxc_SGGA( W1up, W1dn,SmoothExc)
Complex, Intent(INOUT) :: W1up(:), W1dn(:)
Real, INTENT(INOUT) :: SmoothExc
Complex, Pointer :: W2up(:), W2dn(:), Dave1(:),Dave2(:)
W2up = 0
W2dn = 0
W = 0

W2up(i) = CMPLX(dfxdgbgup,0)
W2dn(i) = CMPLX(dfxdgbgdn,0)

Dave1=W2up+W2dn
Dave2=W2up+W2dn
write(log_unit,*) 'mag of vxc**2-G',dot_product((W2up+W2dn),(W2up+W2dn))
! write(log_unit,*) 'mag of vxc**2-G',dot_product(Dave1,Dave2)

Return
End Subroutine

% pgf90 -r8 -c test.f90 -V

pgf90 6.2-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.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
PGF90-S-0000-Internal compiler error. transform_call:Array Expression can't be here      99 (test.f90: 14)
PGF90-S-0000-Internal compiler error. transform_call:Array Expression can't be here      99 (test.f90: 14)
  0 inform,   0 warnings,   2 severes, 0 fatal for calcvxc_sgga


% pgf90 -r8 -c test.f90 -V

pgf90 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.


Technical Problem Report 4025


Case demonstrates that OPEN and INQUIRE handle file names with a trailing NULL character differently.

% cat test.f
C Test of Inquire
       LOGICAL LOP1, LOP2
       CHARACTER*120 File1, File2
       File1 = "foo.0"//CHAR(0)
       File2 = "foo.0"
       OPEN (23,FILE=File1)
       INQUIRE(FILE=File1,OPENED=LOP1,NUMBER=NUM1)
       write(*,*) "File1 ", File1, "LOP1 ", LOP1, "NUM1 ", NUM1
C Comment out the close below to get a failure on the second open
       CLOSE(23)
       OPEN (24,FILE=File2)
       INQUIRE(FILE=File2,OPENED=LOP2,NUMBER=NUM2)
       write(*,*) "File2 ", File2, "LOP2 ", LOP2, "NUM2 ", NUM2
       end

% pgf90 -o test_625 test.f -V

pgf90 6.2-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.2-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.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
% pgf90 -o test_702 test.f -V

pgf90 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
% ./test_625
 File1 
 foo.0                                                                                                                  
 LOP1   F NUM1            -1
 File2 
 foo.0                                                                                                                  
 
 LOP2   T NUM2            24
% ./test_702
 File1 
 foo.0                                                                                                                  
 LOP1   T NUM1            23
 File2 
 foo.0                                                                                                                  
 
 LOP2   T NUM2            24

Technical Problem Report 4027


A set of subroutines that use a common block containing a pointer to a three element real array. The common block is made thread private using the OMP directive !$OMP THREADPRIVATE. When the mp option is used and an element in the array is modified all three elements in the array are updated rather than the specified index.

% cat tp1.f
        subroutine sub(iii)
        integer, pointer :: alph(:)
        common/zzzz/alph
!$omp   threadprivate(/zzzz/)
!!      common/yyyy/ibcd(11)
!!$omp  threadprivate(/yyyy/)
!       print *, iii
        allocate(alph(11))
        alph = 0
        alph(iii+1) = iii+1
!!      ibcd(iii+1) = iii+1
        print *, alph(1),alph(2),alph(3),alph(4)
!!      print *, ibcd(1),ibcd(2),ibcd(3),ibcd(4)
        end
        integer omp_get_thread_num
!$omp parallel
        call sub(omp_get_thread_num())
!$omp endparallel
        end

% cat tp2.f
        subroutine sub(iii)
        integer, pointer :: alph(:)

!$omp   threadprivate(alph)
!!      common/yyyy/ibcd(11)
!!$omp  threadprivate(/yyyy/)
!       print *, iii
        allocate(alph(11))
        alph = 0
        alph(iii+1) = iii+1
!!      ibcd(iii+1) = iii+1
        print *, alph(1),alph(2),alph(3),alph(4)
!!      print *, ibcd(1),ibcd(2),ibcd(3),ibcd(4)
        end
        integer omp_get_thread_num
!$omp parallel
        call sub(omp_get_thread_num())
!$omp endparallel
        end

% pgf90 -V

pgf90 6.2-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 -mp -o tp1_625 tp1.f
% pgf90 -mp -o tp2_625 tp2.f

% pgf90 -V

pgf90 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.

% pgf90 -mp -o tp1_702 tp1.f
% pgf90 -mp -o tp2_702 tp2.f

% ./tp1_625
Warning: OMP_NUM_THREADS or NCPUS (4) greater than available cpus (2)
            1            1            1            1
            2            2            2            2
            3            3            3            3
            4            4            4            4
% ./tp2_625
Warning: OMP_NUM_THREADS or NCPUS (4) greater than available cpus (2)
            1            1            1            1
            2            2            2            2
            3            3            3            3
            4            4            4            4

% ./tp1_702
Warning: OMP_NUM_THREADS or NCPUS (4) greater than available cpus (2)
            1            0            0            0
            0            2            0            0
            0            0            3            0
            0            0            0            4
% ./tp2_702
Warning: OMP_NUM_THREADS or NCPUS (4) greater than available cpus (2)
            1            0            0            0
            0            2            0            0
            0            0            3            0
            0            0            0            4

Technical Problem Report 4026


IMPLIED DO error where there is none, and compiler crash where there is an error.

> cat test1.f
MODULE NOT_IMPLIED_DO

TYPE TEST
REAL R, R2(2,3)
END TYPE TEST

REAL, PARAMETER :: Q(2,3)=0
TYPE(TEST),PARAMETER :: BUGGED = TEST(0,Q)
END MODULE
> cat test2.f
MODULE NOT_IMPLIED_DO

TYPE TEST
REAL R, R2(2,3)
END TYPE TEST

REAL, PARAMETER :: Q(2,3)=0
TYPE(TEST),PARAMETER :: BUGGED = BLAH(0,Q)
END MODULE

> pgf90 -c test1.f
PGF90-S-0069-Illegal implied DO expression (test1.f: 8)
0 inform, 0 warnings, 1 severes, 0 fatal for not_implied_do


> pgf90 -c test2.f
PGF90-S-0000-Internal compiler error. unexpected ast type in
initialization expr 16 (test2.f: 8)
pgf90-Fatal-/opt/pgi/6.2.5/linux86-64/6.2/bin/pgf901 TERMINATED by
signal 11 Arguments to /opt/pgi/6.2.5/linux86-64/6.2/bin/pgf901
/opt/pgi/6.2.5/linux86-64/6.2/bin/pgf901 test2.f -opt 1 -terse 1
-inform warn -nohpf -nostatic -x 19 0x400000 -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 -x 58 0x78031040 -x 48 4608 -x 49 0x100 -x 120 0x200
-stdinc
/opt/pgi/6.2.5/linux86-64/6.2/include:/usr/local/include:/usr/lib64/gcc-lib/x86_64-suse-linux/3.2.2/include:/usr/lib64/gcc-lib/x86_64-suse-linux/3.2.2//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__
-nofreeform -vect 48 -output /tmp/pgf90eLFgmPZs_Wtl.ilm

Technical Problem Report 4028


A simple program with an error causes a compiler ICE.

% cat test.f90
PROGRAM test
IMPLICIT NONE
G(2) = 0
END PROGRAM test

% pgf90 -V test.f90

pgf90 6.2-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.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
PGF90-S-0072-Assignment operation illegal to external procedure g (test.f90: 3)
PGF90-S-0000-Internal compiler error. sym_of_ast: unexpected ast      12 (test.f90: 3)
PGF90-S-0038-Symbol, g, has not been explicitly declared (test.f90)
  0 inform,   0 warnings,   3 severes, 0 fatal for test

% pgf90 -V test.f90

pgf90 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90-S-0072-Assignment operation illegal to external procedure g (test.f90: 3)
PGF90-S-0038-Symbol, g, has not been explicitly declared (test.f90)
  0 inform,   0 warnings,   2 severes, 0 fatal for test

Technical Problem Report 4029


Similar to 4028.

% cat test.f90
SUBROUTINE A
TYPE T
DOUBLE COMPLEX :: X
END TYPE T

TYPE(T) :: TT
DOUBLE PRECISION :: Z

TT%Y = TT%Y * Z
END SUBROUTINE

% pgf90 -V test.f90 -c

pgf90 6.2-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.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
PGF90-S-0142-y is not a member of this RECORD (test.f90: 9)
PGF90-S-0142-y is not a member of this RECORD (test.f90: 9)
PGF90-S-0000-Internal compiler error. sym_of_ast: unexpected ast       0 (test.f90: 9)
  0 inform,   0 warnings,   3 severes, 0 fatal for a

% pgf90 -V test.f90 -c

pgf90 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90-S-0142-y is not a member of this RECORD (test.f90: 9)
PGF90-S-0142-y is not a member of this RECORD (test.f90: 9)
  0 inform,   0 warnings,   2 severes, 0 fatal for a

Technical Problem Report 4031


A user's example causes the compiler to seg fault. Now it only reports a severe error.


Technical Problem Report 4032


User's example causes the an Internal Compiler Error (ICE).

% cat test.c
#include 

struct bar_t {
bool a;
};

int foo() {
struct bar_t c, d;
c = d;
}

% pgcc -V -c test.c

pgcc 6.2-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.
PGC/x86-64 Linux/x86-64 6.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
PGC-S-0000-Internal compiler error. copy_elem, unexp. dt      11 (test.c: 9)
PGC-S-0000-Internal compiler error. copy_elem, unexp. dt      11 (test.c: 9)
PGC/x86-64 Linux/x86-64 6.2-5: compilation completed with severe errors


% pgcc -V -c test.c

pgcc 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGC/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.

Technical Problem Report 4034


xxx

% cat test.f90
INTEGER,PARAMETER :: mat_ptr = int(floor(2d0))
END


% pgf90 -V -c test.f90

pgf90 6.2-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.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
PGF90-S-0000-Internal compiler error. unexpected ast type in initialization expr      12 (test.f90: 1)
pgf90-Fatal-/tmp/pgi625/linux86-64/6.2/bin/pgf901 TERMINATED by signal 11
Arguments to ......
-def __SSE__ -def __MMX__ -def __SSE2__ -freeform -vect 48 -output /tmp/pgf90ygJciO_cmjYk.ilm


% pgf90 -V -c test.f90

pgf90 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.



Technical Problem Report 4036


Threadprivate global variable not used in contained subprograms.

% cat test.f90
implicit none
integer, save :: ix=0
!$OMP THREADPRIVATE(ix)
write(*,*) 'before ix =',ix
call process_options
write(*,*) 'ix after process_options ', ix
call initialize_gfsr
return
contains
subroutine process_options
ix=0
ix = 2*5
return
end subroutine process_options
subroutine initialize_gfsr
if (ix /= 0) then
write(*,*) 'hello'
endif
return
end subroutine initialize_gfsr
end


% pgf90 -V

pgf90 6.2-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 -mp -o test_625 test.f90

% pgf90 -V

pgf90 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
% pgf90 -mp -o test_702 test.f90

% ./test_625
 before ix =            0
 ix after process_options             0
% ./test_702
 before ix =            0
 ix after process_options            10
 hello

Technical Problem Report 4038


The pgCC switch -MM should only give user include header file dependencies. Instead, it gives all headers This has been corrected.


Technical Problem Report 4041


A user wanted to use a Module in a DLL. The subroutines exported properly and you are able to export variables. When you tried to use the exported variables in a program, it appears that there are two copies of the variables, one local and one in the module. There should only be one. This has been corrected.


Technical Problem Report 4043


A major appication was finding errors in their standard tests. The problem was isolated and fixed.


Technical Problem Report 4044


The code below results in a segfault when compiled and run on a linux x86_64 AMD platform. Removing the scalar multiplication at the front of the outputted array (zfni) will make the problem go away but it is an allowed operation, hence a bug.

program tst
implicit none
real(8) :: zfni
integer(8) :: iout(3),jout(3)
integer(8) :: ii,jj
real(8), dimension(205,205) :: phi
iout(1)=1
iout(2)=205
iout(3)=2
jout(1)=1
jout(2)=205
jout(3)=2
zfni=4.0
do jj=1,205
do ii=1,205
phi(ii,jj)=real(ii)*real(jj)
enddo
enddo
open (20,file='tmp',form='unformatted')
write (20)
zfni*phi(iout(1):iout(2):iout(3),jout(1):jout(2):jout(3))
close(20)
stop
end

Technical Problem Report 4045


Code illustrates a problem when an allocatable array in a dervived type is used on the LHS of an assignment in a forall construct.


Technical Problem Report 4048


Some Users commented that since PGI compilers run on Linux and Windows systems, we should not refer to Netscape browsers in our documents. Moving to generic browser references.


Technical Problem Report 4050


The 64-bit libpgc.a library has a non-fpic object in it which can ruin the build of another shared library that uses it. This has been corrected.


Technical Problem Report 4052


call exit(code) fails to echo code.

% cat test.f90
program test
implicit none
integer :: code
print *,"Enter an integer: "
read *,code
call exit(code)
end program test


% pgf90 -o test_625 -V test.f90

pgf90 6.2-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.2-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.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.

% pgf90 -o test_702 -V test.f90

pgf90 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.

% ./test_625
 Enter an integer: 
15
% echo $?
127
% ./test_702
 Enter an integer: 
15
% echo $?
15


Technical Problem Report 4053


An include file in the PGI include area contained the line #include "/usr/include/stdlib.h" should be #include_next "stdlib.h" This has been corrected.


Technical Problem Report 4054


A program failed in release 6.2-5 because -Msignextend was not default, and it failed without the switch. The reasons we did not make -Msignextend default have been corrected, and we now agree with gcc in this regard.


Technical Problem Report 4055


A user pointed out that our documentation implied that we had three types of fast math routines, but we only have two types. This has been corrected.


Technical Problem Report 4056


pgcc inline assembly fails with the user example.

% cat test.c

typedef struct {        /* standard complex number declaration for single- */
   float real;          /* precision complex numbers                  */
   float imag;
} complex;
 
typedef struct { complex e[3][3]; } su3_matrix;
 
/* These assembly inline versions work only with the gnu C compiler
   on Opteron processors */
 
#define _inline_sse_mult_su3_an(aa,bb) \
{ \
__asm__ __volatile__ ("movlps %0, %%xmm7 \n\t" \
                      "movaps %%xmm7, %%xmm0 \n\t" \
                      "unpcklps %%xmm0, %%xmm0 \n\t" \
                      "movhlps %%xmm0, %%xmm3 \n\t" \
                      "movlhps %%xmm0, %%xmm0 \n\t" \
                      "movhps %1, %%xmm7 \n\t" \
                      "movaps %%xmm7, %%xmm1 \n\t" \
                      "unpckhps %%xmm1, %%xmm1 \n\t" \
                      "movhlps %%xmm1, %%xmm4 \n\t" \
                      "movlhps %%xmm1, %%xmm1 \n\t" \
                      "movlps %2, %%xmm10 \n\t" \
                      "movaps %%xmm10, %%xmm2 \n\t" \
                      "unpcklps %%xmm2, %%xmm2 \n\t" \
                      "movhlps %%xmm2, %%xmm5 \n\t" \
                      "movlhps %%xmm2, %%xmm2 \n\t" \
                      "movlps %3, %%xmm12 \n\t" \
                      "movhps %4, %%xmm12 \n\t" \
                      "mulps %%xmm12, %%xmm0 \n\t" \
                      "movlps %5, %%xmm13" \
                      : \
                      : \
                      "m" ((aa)->e[0][0]), \
                      "m" ((aa)->e[1][0]), \
                      "m" ((aa)->e[2][0]), \
                      "m" ((bb)->e[0][0]), \
                      "m" ((bb)->e[0][1]), \
                      "m" ((bb)->e[1][0])\
                      : \
                      "%xmm0", \
                      "%xmm1", \
                      "%xmm10", \
                      "%xmm12", \
                      "%xmm13", \
                      "%xmm2", \
                      "%xmm3", \
                      "%xmm4", \
                      "%xmm5", \
                      "%xmm7"); \
}
 
void mult(su3_matrix *m1, su3_matrix *m4) {
  _inline_sse_mult_su3_an(m4,m1);
}


% pgcc -V -c  test.c

pgcc 6.2-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.
PGC/x86-64 Linux/x86-64 6.2-5
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc.  All Rights Reserved.
PGC-W-0352-Constraint/expression type mismatch in extended ASM operand 1 (test.c: 55)
PGC-W-0352-Constraint/expression type mismatch in extended ASM operand 2 (test.c: 55)
PGC-W-0352-Constraint/expression type mismatch in extended ASM operand 4 (test.c: 55)
PGC-W-0352-Constraint/expression type mismatch in extended ASM operand 5 (test.c: 55)
PGC/x86-64 Linux/x86-64 6.2-5: compilation completed with warnings
/tmp/pgccLG_bVPt2xoJ_.s: Assembler messages:
/tmp/pgccLG_bVPt2xoJ_.s:42: Error: suffix or operands invalid for `movhps'
/tmp/pgccLG_bVPt2xoJ_.s:47: Error: suffix or operands invalid for `movlps'
/tmp/pgccLG_bVPt2xoJ_.s:53: Error: suffix or operands invalid for `movhps'
/tmp/pgccLG_bVPt2xoJ_.s:55: Error: suffix or operands invalid for `movlps'
% settmp64702
% pgcc -V -c test.c

pgcc 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
PGC/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.

Technical Problem Report 4057


Customer wanted specific I/O libraries created.


Technical Problem Report 4059


User code had erroneous Overlapping data initializations warnings. This has been corrected.


Technical Problem Report 4060


Program seg faults with character length >64, and TRANSFER function

% cat Fortran-TRANSFER-Bug.F90
PROGRAM testb
IMPLICIT none
CHARACTER(len=VECT_LENGHT) :: vect(1)
real :: mvect(3000)
CHARACTER(len=1), ALLOCATABLE :: cvect(:)
INTEGER :: length
vect(1)='a'!(/'ippaaa0','ippaaa1','ippaaa2'/)
WRITE(*,*) 'Say hi!'
mvect=TRANSFER(vect,mvect)
WRITE(*,*) 'Toto'
END PROGRAM testb

Technical Problem Report 4062


User program caused PGC-F-0000-Internal compiler error. filename too long 0 () failure. This has been corrected.


Technical Problem Report 4065


Simple fortran OPEN test works with pgf77, fails with pgf90.

% more test.f
program test
open(1,file='test.out',access='append', FORM='FORMATTED')
write(1,*) 'append2 test'
close(1)
stop
end
% pgf77 -o test test.f
% test
FORTRAN STOP
% pgf90 -o test test.f
% ./test
PGFIO-F-201/OPEN/unit=1/illegal value for specifier.
File name = test.out
In source file test.f, at line number 2

Technical Problem Report 4067


Program runs corrected only when you include a module the progrma does not reference.

% cat testa.f90
MODULE G
IMPLICIT NONE
SAVE
TYPE TYPE_Y
INTEGER :: U=1
INTEGER :: V=2
INTEGER :: T=3
INTEGER :: Q=4
END TYPE TYPE_Y
TYPE(TYPE_Y) :: Y
END MODULE
PROGRAM TEST
! You need this with pgf90
! USE G
call mumble
END PROGRAM
SUBROUTINE MUMBLE
USE G
print *,"Y%V",Y%V
END SUBROUTINE


% cat testb.f90
MODULE G
IMPLICIT NONE
SAVE
TYPE TYPE_Y
INTEGER :: U=1
INTEGER :: V=2
INTEGER :: T=3
INTEGER :: Q=4
END TYPE TYPE_Y
TYPE(TYPE_Y) :: Y
END MODULE
PROGRAM TEST
! You need this with pgf90
USE G
call mumble
END PROGRAM
SUBROUTINE MUMBLE
USE G
print *,"Y%V",Y%V
END SUBROUTINE

% pgf90 -V

pgf90 6.2-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 -o testa_625 testa.f90
% pgf90 -o testb_625 testb.f90

% pgf90 -V

pgf90 7.0-2 64-bit target on x86-64 Linux 
Copyright 1989-2000, The Portland Group, Inc.  All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc.  All Rights Reserved.
% pgf90 -o testa_702 testa.f90
% pgf90 -o testb_702 testb.f90



% ./testa_625
 Y%V            0
% ./testb_625
 Y%V            2
% ./testa_702
 Y%V            2
% ./testb_702
 Y%V            2


Technical Problem Report 4069


CDK mpif90, mpif77, etc scripts need to act exactly like pgf90 -Mmpi or -Mmpi2. There were differences in libs used and lib order, and that has been corrected.


Technical Problem Report 4072


User example caused pgCC to seg fault when compiling with -Mipa. This has been corrected.


Technical Problem Report 4073


We did not include librt.so when -pgf77libs or -pgf90libs is used with pgcc. This has been corrected.


Technical Problem Report 4076


pgcc and pgCC using VLA after a block that reads size causes a compiler ICE. This has been corrected.


Technical Problem Report 4077


A user example would not link as expected with -mcmodel=medium, but would without the switch. This has been corrected.


Technical Problem Report 4078


Our beta Windows SUA product exhibited errors when the executable is stripped. This has been corrected.


Technical Problem Report 4080


liblapack and libblas were left out of the Windows compiler packages, and this has been corrected.


Technical Problem Report 4083


32-bit pgCC does not read back 'long long' from file properly.

% more ioLongLong.cc
#include 
#include 
#include 
#include 
#include 
#include 

using namespace std;

int main (int argc, char ** argv)
{
const char fileName[] = "my8bytes.tmp";

#ifndef READ_ONLY
ofstream out (fileName);
assert (out != NULL);
const long long outLongLong = 0xdeadbeefdeadbeefLL;
out << outLongLong;
out.close();
cout << "wrote " << hex << outLongLong << " to ";
#endif

cout << "file " << fileName;

ifstream in (fileName);
assert (in != NULL);
long long inLongLong = 17;
in >> inLongLong;
in.close();
cout << ", read " << hex << inLongLong << endl;

exit (0);
return (0);
}

% g++ -o ioLongLong_gcc ioLongLong.cc
% ./ioLongLong_gcc
wrote deadbeefdeadbeef to file my8bytes.tmp, read deadbeefdeadbeef

With the file my8bytes.tmp created by the g++ version, let's read it with
the pgCC compiled versions.

% pgCC -DREAD_ONLY -tp px -o ioLongLong_px ioLongLong.cc -V

pgCC 7.0-2a 32-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc. All Rights Reserved.
Edison Design Group C/C++ Front End, version 3.6 (Jan 26 2007 22:44:19)
Copyright 1988-2006 Edison Design Group, Inc.

PGCC/x86 Linux 7.0-2a
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc. All Rights Reserved.

% pgCC -DREAD_ONLY -tp k8-32 -o ioLongLong_k832 ioLongLong.cc
% pgCC -DREAD_ONLY -tp k8-64 -o ioLongLong_k864 ioLongLong.cc
% pgCC -DREAD_ONLY -tp x64 -o ioLongLong_x64 ioLongLong.cc
% pgCC -DREAD_ONLY -tp piv -o ioLongLong_piv ioLongLong.cc


Notice the 32-bits fail, while the 64-bit versions do not.

% ./ioLongLong_k864
file my8bytes.tmp, read deadbeefdeadbeef
% ./ioLongLong_x64
file my8bytes.tmp, read deadbeefdeadbeef
% ./ioLongLong_piv
file my8bytes.tmp, read 8000000000000000
% ./ioLongLong_k832
file my8bytes.tmp, read 8000000000000000
% ./ioLongLong_px
file my8bytes.tmp, read 8000000000000000

Technical Problem Report 4087


This test case points out a bug when pointers are in common. We do allow them, but the storage order of the common is wrong. Specifically, we placed the nonpointer variables after the pointer's compiler-created variables.


Technical Problem Report 4099


The stack command in the win32 pgdbg is providing information about just the current routine even if the current routine is not main. The stack command is working correctly in the win64 pgdbg. This problem affects the contents of the Stack Window in PVF.


Technical Problem Report 4110


SUA64: MP Correctness test report stack overflow when compiled with -Mchkstk.

Example:
pgcc -c -I/dev/fs/Q/tests/mp -fast -Mchkstk -V7.0-2 -mp /dev/fs/Q/tests/mp/check.c
pgf90 -c -I/dev/fs/Q/tests/mp -fast -Mchkstk -V7.0-2 -mp /dev/fs/Q/tests/mp/do10.f
pgf90 -fast -Mchkstk -V7.0-2 -mp do10.o check.o -o a.out
------------ executing test do10
./RUNPAR 4 ./a.out
Error: in routine sp2 there is a
Error: in routine sp2 there is a
Error: in routine sp2 there is a
stack overflow: thread 0, max 10561KB, used 2KB, request 64B
stack overflow: thread 0, max 10561KB, used 2KB, request 64B
stack overflow: thread 0, max 10561KB, used 2KB, request 64B

Technical Problem Report 4117


User thinks warnings about variables that do not become too long until the compiler decorates them, are not worth reporting.

pgf90 -c geometry_class.f90 -Mstandard -V

pgf90 7.0-2 64-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc. All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc. All Rights Reserved.
PGF90-W-0016-Identifier, get_instance_geometry_1_geo$v$sd, truncated to 31 chars (geometry_class.f90: 549)
PGF90-W-0016-Identifier, get_instance_geometry_1_geo$v117, truncated to 31 chars (geometry_class.f90: 549)
PGF90-W-0016-Identifier, get_instance_geometry_1_geo$v11$sd, truncated to 31 chars (geometry_class.f90: 549)
PGF90-W-0016-Identifier, get_instance_geometry_1_geo$v11$o, truncated to 31 chars (geometry_class.f90: 549)
PGF90-W-0016-Identifier, get_instance_geometry_1_geo$v11$p, truncated to 31 chars (geometry_class.f90: 549)
0 inform, 5 warnings, 0 severes, 0 fatal for get_instance_geometry_2_geo
PGF90-W-0016-Identifier, get_instance_geometry_1_geo$v$sd, truncated to 31 chars (geometry_class.f90: 620)
PGF90-W-0016-Identifier, get_instance_geometry_1_geo$v169, truncated to 31 chars (geometry_class.f90: 620)
PGF90-W-0016-Identifier, get_instance_geometry_1_geo$v16$sd, truncated to 31 chars (geometry_class.f90: 620)
PGF90-W-0016-Identifier, get_instance_geometry_1_geo$v16$o, truncated to 31 chars (geometry_class.f90: 620)
PGF90-W-0016-Identifier, get_instance_geometry_1_geo$v16$p, truncated to 31 chars (geometry_class.f90: 620)
0 inform, 5 warnings, 0 severes, 0 fatal for process_input_geometry_geo
PGF90-W-0016-Identifier, get_instance_geometry_1_geo$v$sd, truncated to 31 chars (geometry_class.f90: 984)
PGF90-W-0016-Identifier, get_instance_geometry_1_geo$v361, truncated to 31 chars (geometry_class.f90: 984)
PGF90-W-0016-Identifier, get_instance_geometry_1_geo$v36$sd, truncated to 31 chars (geometry_class.f90: 984)
PGF90-W-0016-Identifier, get_instance_geometry_1_geo$v36$o, truncated to 31 chars (geometry_class.f90: 984)
PGF90-W-0016-Identifier, get_instance_geometry_1_geo$v36$p, truncated to 31 chars (geometry_class.f90: 984)
0 inform, 5 warnings, 0 severes, 0 fatal for check_consistency_geom_2_geo

Technical Problem Report 4118


Release7.0-2 pgf90did not support !DEC$directives the way6.2-5did.


Technical Problem Report 4119


endparallel is not treated the same as end parallel in OpenMP

% cat test.f90
! extracted from OpenMP test omp1/F2_1_1_2_1a.f90
use omp_lib
implicit none
integer, parameter :: N=100000
double precision :: a(N),b(N),c(N)
integer i
call random_number(a)
call random_number(b)
!$omp paralleldo default(none) shared(a,b,c) schedule(static)
do i = 1, N
c(i) = b(i) * a(i)
enddo
!$omp endparallel do
print *, c(1),c(N)
end

Technical Problem Report 4137


Unknown options are now treated as errors instead of warnings. This change makes it a compiler error to pass switches that are not known to the compiler. But users want their build scripts to work as before.

Added switch -noswitcherror, to turn switch errors into warnings instead also allows a user to 'set NOSWITCHERROR=1;' in a siterc file for the same behavior globally.


Technical Problem Report 4145


OpenMP Directive NUM_THREADS extends outside scope of current section. This test case was extracted from OpenMP test omp1/F2_2_1a.f90, which tests if a NUM_THREADS clause on an omp parallel directive affects the next omp parallel directive which does not have a NUM_THREADS clause appearing on it.

% cat test.f90
! extracted from OpenMP test omp1/F2_2_1a.f90
use omp_lib
implicit none
integer, parameter :: NT = 4
integer :: i = 0

call omp_set_dynamic(.false.)
call omp_set_num_threads(NT+4)

!$omp parallel default(none) shared(i)
!$omp atomic
i = i+1
!$omp end parallel
if(i /= NT+4) then
print*, '1 FAIL - wrong number of threads, i=',i
endif

i=0
!$omp parallel default(none) shared(i) NUM_THREADS(NT)
!$omp atomic
i = i+1
!$omp end parallel
if(i /= NT) then
print*, '2 FAIL - wrong number of threads, i=',i
endif
!
! this loop does not revert back to 8 threads
!
i=0
!$omp parallel default(none) shared(i)
!$omp atomic
i = i+1
!$omp end parallel
if(i /= NT+4) then
print*, '3 FAIL - wrong number of threads, i=',i
endif

END

% pgf90 -mp -o test test.f90 -V

pgf90 7.0-2 32-bit target on x86 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc. All Rights Reserved.
PGF90/x86 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc. All Rights Reserved.
PGF90/x86 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc. All Rights Reserved.

% ./test
Warning: omp_set_num_threads (8) greater than available cpus (1)
3 FAIL - wrong number of threads, i= 4

Technical Problem Report 4146


The optimization of the code for the two test cases is significantly different, with test1.f90 generating slower code. On some benchmark codes the version without the TARGET attribute is more than twice as fast. This is a significant performance issue.

% cat test1.f90
subroutine tt(b,c,n)
integer n
real b(n),c(n)
real , allocatable, TARGET :: a(:)
ALLOCATE(A(n))
do i=1,n
a(i)=b(i)*c(i)
enddo
call sub(a)
end
harrier% cat test2.f90
subroutine tt(b,c,n)
integer n
real b(n),c(n)
real , allocatable :: a(:)
ALLOCATE(A(n))
do i=1,n
a(i)=b(i)*c(i)
enddo
call sub(a)
end
% diff test1.f90 test2.f90
4c4
< real , allocatable, TARGET :: a(:)
---
> real , allocatable :: a(:)


% pgf90 -c -r8 -Minfo=all -fastsse test1.f90 -V

pgf90 7.0-2 64-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc. All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc. All Rights Reserved.
PGF90/x86-64 Linux 7.0-2
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2007, STMicroelectronics, Inc. All Rights Reserved.
tt:
6, Unrolled inner loop 4 times
Generated 2 prefetch instructions for this loop
% pgf90 -c -r8 -Minfo=all -fastsse test2.f90
tt:
6, Generated 4 alternate loops for the inner loop
Generated vector sse code for inner loop
Generated 2 prefetch instructions for this loop
Generated vector sse code for inner loop
Generated 2 prefetch instructions for this loop
Generated vector sse code for inner loop
Generated 2 prefetch instructions for this loop
Generated vector sse code for inner loop
Generated 2 prefetch instructions for this loop
Generated vector sse code for inner loop