g77 boolean functions problems

Pasha Murat (murat@cdfsga.fnal.gov)
Tue, 16 Mar 1999 09:58:39 -0600 (CST)


Jacek M. Holeczek writes:
> Hi,
> It's not strictly a root problem, but ...
> I use pgcc-1.1.1 and I think there is a problem with it's g77 compiler.
> It's not clear if it is a problem of the pgcc, or the egcs-1.1.1 itself
> In case it is a common problem of egcs-1.1.1 and pgcs-1.1.1, I think I
> will need to downgrade to egcs-1.0.2 ( as comes with RH5.2 ). In this case
> - are there any contraindications from the root team ?
> I could also try the egcs-1.1b rpms - but does anyone has any good/bad
> experience with this version ?
> I would like to ask someone who has the "pure" egcs-1.1.1 ( and maybe
> egcs-1.1b ) installed to test the following bug in g77 boolean functions :
> --------------------------------------------------------------------------
> integer*4 ibol,ibol1,ipas,ipas1
>
> ibol = '87654321'x
> print'(z8)',ibol
>
> ibol1 = 'ffffffff'x
> print'(z8)',ibol1
>
> ipas=iand(ibol,ibol1)
> print'(z8)',ipas
>
> ipas1=ishft(ipas,-8)
> print'(z8)',ipas1
>
> stop
> end
> --------------------------------------------------------------------------
> Wrong output from "g77 -g" { g77 version pgcc-2.91.60 19981201
> (egcs-1.1.1 release) (from FSF-g77 version 0.5.24-19980804) } ( could you
> please also send me the output from "g77 -v", as shown here ) :
> --------------------------------------------------------------------------
> 87654321
> FFFFFFFF
> 21
> 0
> --------------------------------------------------------------------------
> In both cases ( iand, ishft ) only the least significant BYTE is taken into
> account ( instead of the whole integer ).
> Correct output from "fort77" ( and egcs-1.0.2 ) :
> --------------------------------------------------------------------------
> 87654321
> FFFFFFFF
> 87654321
> 876543
> --------------------------------------------------------------------------
> Thanks in advance,
> Best regards,
> Jacek.

Hi -
I tried your example with one of the '99 EGCS snapshots and it seems that
the problem is platform (or - version) dependent - on SGI/IRIX6 your example
produces the desired output.
-pasha
--------------------------------------------------------------------------------
/cdf/upgrade/tracking/murat/g3/test>g77 -v -o test_yacek.exe ~/test/test_yacek.F
g77 version egcs-2.93.02 19990117 (gcc2 ss-980609 experimental) (from FSF-g77 version 0.5.24-19980804)
Driving: g77 -v -o test_yacek.exe /home/lv0/murat/test/test_yacek.F -lg2c -lm
Reading specs from /data69/upgrade/murat/egcs-19990117/lib/gcc-lib/mips-sgi-irix5.3/egcs-2.93.02/specs
gcc version egcs-2.93.02 19990117 (gcc2 ss-980609 experimental)
/data69/upgrade/murat/egcs-19990117/lib/gcc-lib/mips-sgi-irix5.3/egcs-2.93.02/cpp -lang-c -v -isystem /data61/top/murat/bin/include -undef -D__GNUC__=2 -D__GNUC_MINOR__=93 -D__unix__ -D__mips__ -D__sgi__ -D__host_mips__ -D__MIPSEB__ -D_MIPSEB -D__SYSTYPE_SVR4__ -D_SVR4_SOURCE -D_MODERN_C -D__DSO__ -D_MIPS_SIM=_MIPS_SIM_ABI32 -D_MIPS_SZPTR=32 -D__unix -D__mips -D__sgi -D__host_mips -D__MIPSEB -D__SYSTYPE_SVR4 -Asystem(unix) -Asystem(svr4) -Acpu(mips) -Amachine(sgi) -D_LANGUAGE_FORTRAN -D__CHAR_UNSIGNED__ -traditional -D__LANGUAGE_C -D_LANGUAGE_C -DLANGUAGE_C -D__SIZE_TYPE__=unsigned int -D__PTRDIFF_TYPE__=int -D__EXTENSIONS__ -D_SGI_SOURCE -D_LONGLONG -D_MIPS_FPSET=16 -D_MIPS_ISA=_MIPS_ISA_MIPS1 -D_MIPS_SZINT=32 -D_MIPS_SZLONG=32 /home/lv0/murat/test/test_yacek.F /var/tmp/ccAReKpZ.i
GNU CPP version egcs-2.93.02 19990117 (gcc2 ss-980609 experimental) [AL 1.1, MM 40] SGI running IRIX 5.x
#include "..." search starts here:
#include <...> search starts here:
/data69/upgrade/murat/egcs-19990117/include
/data69/upgrade/murat/egcs-19990117/mips-sgi-irix5.3/include
/data69/upgrade/murat/egcs-19990117/lib/gcc-lib/mips-sgi-irix5.3/egcs-2.93.02/include
/usr/include
End of search list.
/data69/upgrade/murat/egcs-19990117/lib/gcc-lib/mips-sgi-irix5.3/egcs-2.93.02/f771 /var/tmp/ccAReKpZ.i -quiet -dumpbase test_yacek.F -version -fversion -o /var/tmp/ccaw1MXQ.s
GNU F77 version egcs-2.93.02 19990117 (gcc2 ss-980609 experimental) (mips-sgi-irix5.3) compiled by GNU C version egcs-2.91.57 19980901 (egcs-1.1 release).
GNU Fortran Front End version 0.5.24-19980804
/data61/top/murat/bin/as -v -o /var/tmp/cc4iBJpN.o /var/tmp/ccaw1MXQ.s
GNU assembler version 2.9.1 (mips-sgi-irix5.3), using BFD version 2.9.1
/data69/upgrade/murat/egcs-19990117/lib/gcc-lib/mips-sgi-irix5.3/egcs-2.93.02/collect2 -call_shared -no_unresolved -old_ld -_SYSTYPE_SVR4 -o test_yacek.exe /usr/lib/crt1.o -L/data69/upgrade/murat/egcs-19990117/lib/gcc-lib/mips-sgi-irix5.3/egcs-2.93.02 -L/data69/upgrade/murat/egcs-19990117/lib /var/tmp/cc4iBJpN.o -lg2c -lm -lgcc -lc -lgcc /usr/lib/crtn.o
/cdf/upgrade/tracking/murat/g3/test>test_yacek.exe
87654321
FFFFFFFF
87654321
876543