www.delorie.com/archives/browse.cgi   search  
Mail Archives: pgcc/1999/03/15/08:53:13

Date: Mon, 15 Mar 1999 14:49:57 +0100 (MET)
From: "Jacek M. Holeczek" <holeczek AT us DOT edu DOT pl>
X-Sender: holeczek AT uranos DOT cto DOT us DOT edu DOT pl
To: pgcc AT delorie DOT com, info AT foyer DOT se
Subject: g77 boolean functions problems
Message-ID: <Pine.GSO.3.96.990315144219.20974A-100000@uranos.cto.us.edu.pl>
MIME-Version: 1.0
Reply-To: pgcc AT delorie DOT com

Hi,
Please note that there seems to be a 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) } :
--------------------------------------------------------------------------
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" :
--------------------------------------------------------------------------
87654321
FFFFFFFF
87654321
  876543
--------------------------------------------------------------------------
Best regards,
Jacek.
P.S. Please answer directly to me, I'm not on your list. Thanks in
     advance, Jacek.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019