From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: *** X-Spam-Status: No, score=3.8 required=5.0 tests=BAYES_00,INVALID_MSGID, RATWARE_MS_HASH,RATWARE_OUTLOOK_NONAME autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5e7b9eb6024e0c2e,start X-Google-Attributes: gid103376,public From: "Dmitriy Anisimkov" Subject: Comparison with 0 distorts Long_Long_Integer Date: 1998/01/14 Message-ID: <01bd20f8$c1877460$e7207cc1@---->#1/1 X-Deja-AN: 315886920 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Organization: Complex Computer Systems Newsgroups: comp.lang.ada Date: 1998-01-14T00:00:00+00:00 List-Id: I'm use GNAT-3-10 for Win32 and found the BUG : -------------------------------- with Text_Io,Machine_Code; procedure Rli is use Text_Io; subtype IComp is Long_Long_Integer; package Comp_Io is new Integer_IO(IComp); use Comp_Io; C : constant Icomp := 16#1234_0000_0000#; Cb : Icomp; begin Cb := C; if Cb=0 then -- Comparison with 0 distorts Long_Long_Integer null; end if; if C/=Cb then -- it's wrong Put(" C ="); Put(C,0,16); New_Line; Put(" Cb="); Put(Cb,0,16); New_Line; end if; end Rli; ------------------------------- same function in C : /**************************/ #include int main(void){ signed long long int c = 0x123400000000L; signed long long int cb; cb = c; if(cb==0L){ printf("Comparison with 0 distorts signed long long int"); } if (c!=cb){ printf("%l %l",c,cb); } return 0; } /**************************/ from C code if(cb==0L){... generates assembler code / GNU C version 2.7.2 (i586-pc-mingw32) compiled by GNU C version 2.7.2. ... movl -12(%ebp),%edx orl %edx,-16(%ebp) ; Corruption cmpl $0,-16(%ebp) jne L2 I think, it must be movl -12(%ebp),%edx orl -16(%ebp),%edx cmpl $0,%edx jne L2 Does anybody know how to correct this ? May be it is possible to change any EXE files ?