PACK intrinsic bug?
FX
fxcoudert@gmail.com
Tue Aug 12 16:57:00 GMT 2008
Forwarded from Alan, who apparently cannot get it through to the
gcc.gnu.org mail server:
Gfortran (latest 4.4 on all my platforms) is the only compiler I use
(out of XLF, IVF, g95, LF95, PGI) that doesn't handle this correctly.
Al Greynolds
module xparams
integer,parameter :: exprbeg=100,exprend=154
character(*),dimension(exprbeg:exprend),parameter :: &
exprs=(/'nint() ','log10() ','sqrt() ','acos() ','asin()
','atan() ','cosh() ','sinh() ','tanh() ','int() ',&
'cos() ','sin() ','tan() ','exp() ','log() ','abs() ',&
'delta() ','step() ','rect() ','max(,) ','min(,) ','bj0() ',&
'bj1() ','bjn(,) ','by0() ','by1() ','byn(,) ','logb(,) ',&
'erf() ','erfc() ','lgamma()','gamma() ','csch() ','sech() ',&
'coth() ','lif(,,) ','gaus() ','sinc() ','atan2(,)','mod(,) ',&
'nthrt(,)','ramp() ','fbi() ','fbiq() ','uran(,) ','aif(,,,)',&
'sgn() ','cbrt() ','fact() ','somb() ','bk0() ','bk1()
','bkn(,) ','bbi(,,) ','bbiq(,,)'/)
integer,dimension(exprbeg:exprend),parameter :: exprslen=index(exprs,'('),&
cmandcomps=(/1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,2,1,1,2,2,1,1,1,1,1,1,1,3,1,1,2,2,2,1,1,1,2,4,1,1,1,1,1,1,2,3,3/)
integer,parameter :: maxcmandcomps=4
end
program pack_bug
use xparams
do j=1,maxcmandcomps
write(*,'(9(1x,a8))')
(pack(exprs,exprs(:)(:1)==char(i+96).and.cmandcomps==j),i=1,26)
enddo !j
end
More information about the Fortran
mailing list