module your_module
implicit none
public :: foo
contains
subroutine foo ()
end subroutine foo
end module your_module
module my_module
use your_module, your_foo => foo
public :: foo
contains
subroutine foo ()
end subroutine foo
end module my_module
% pgf90 -c bugx.f90 -V
pgf90 5.2-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2004, STMicroelectronics, Inc. All Rights Reserved.
PGF90/any Linux/x86 5.2-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2004, STMicroelectronics, Inc. All Rights Reserved.
PGF90-S-0155-foo is use associated and cannot be redeclared (bugx.f90: 22)
0 inform, 0 warnings, 1 severes, 0 fatal for foo
% cat x.f90
CHARACTER(LEN=4), DIMENSION(2) :: aa
aa=s2a("12","123")
IF (ANY(aa.NE.(/"12 ","123 "/))) CALL ABORT()
CONTAINS
PURE FUNCTION s2a(s1,s2) RESULT(a)
character(LEN=*), INTENT(IN) :: s1,s2
character(LEN=MAX(LEN(s1),LEN(s2))), DIMENSION(2) :: a
a(1)=s1; a(2)=s2
END FUNCTION
END
% pgf90 -o x x.f90 -V
pgf90 5.2-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2004, STMicroelectronics, Inc. All Rights Reserved.
PGF90/any Linux/x86 5.2-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2004, STMicroelectronics, Inc. All Rights Reserved.
PGF90/x86 Linux/x86 5.2-4
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2004, STMicroelectronics, Inc. All Rights Reserved.
% ./x
> cat test.f
program type_conversion
implicit none
integer(kind=8) :: i
real(kind=8) :: r
do i = 1_8, 4294967296_8
r = dfloat( i )
if( r < 0.0d0 ) then
write(0,*) 'i=', i, ' r=', r, 1.0d0*i
exit
end if
end do
write(0,*) 'i=', i
end program type_conversion
> pgf90 test.f
> ./a.out
i= 1
The problem is now with the DFLOAT intrinsic.
We spec DFLOAT as a specific intrinsic whose argument type is
integer*4. In the test case, the argument is integer*8, in
which case we convert the argument to 32-bit; the argument
eventually overflows and DFLOAT produces an unexpected result.
The solution is to replace the DFLOAT with the generic intrinsic DBLE.
Please note that DFLOAT is an 'old' extension to the standard ; we chose
to implement DFLOAT as a specific, which is consistent with the standard
definition of FLOAT.
Closed- Invalid
There are several switches such as -Bstatic, -Bdynamic,
-Wl,--whole-archive which need to be passed to the linker
in the same order that they appear on the compilation line.
The driver needs to be updated to allow these types of
position sensitive switches to preserve their order.
% cat xx.f90
program pgf90_bug
implicit none
real(4) :: t4
real(8) :: t8
character*4 :: c4
t8 = 1000d0
t4 = real(t8,kind=4)
c4 = transfer(source=real(t8,kind=4),mold=c4) !THIS CRASHES
! c4 = transfer(source=t4,mold=c4) !THIS WORKS
end program
% pgf90 -c xx.f90 -V
pgf90 6.0-1 32-bit target on x86 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGF90/any Linux/x86 6.0-1
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2005, STMicroelectronics, Inc. All Rights Reserved.
PGF90-S-0000-Internal compiler error. sym_of_ast: unexpected ast 27 (xx.f90: 10)
0 inform, 0 warnings, 1 severes, 0 fatal for pgf90_bug