Path: utzoo!utgpu!watmath!watdragon!rose!ehoogerbeets From: ehoogerbeets@rose.waterloo.edu (Edwin Hoogerbeets) Newsgroups: comp.sys.amiga.tech Subject: Another Manx v3.6 bug Keywords: Gnu --> quality compiler stress tests at low prices! Message-ID: <14395@watdragon.waterloo.edu> Date: 9 Jun 89 20:17:36 GMT References: <14328@watdragon.waterloo.edu> Sender: daemon@watdragon.waterloo.edu Reply-To: ehoogerbeets@rose.waterloo.edu (Edwin Hoogerbeets) Organization: U. of Waterloo, Ontario Lines: 53 In article <14328@watdragon.waterloo.edu> ehoogerbeets@rose.waterloo.edu (Edwin Hoogerbeets) writes: % I know it is pretty gross % C code, but it occurs in GnuGrep (fish 204), and probably other Gnu % code. Speaking of Gnu code, here is another Manx bug: main() { char *list; char c; c = '8'; list = &c; c = ( list , *list ); } Causes guru 0x00000003, unaligned word or address error. (It is valid, albeit strange, C code isn't it?) Looking at the assembler: [...etc...] ; c = '8'; move.b #56,-5(a5) ; ; list = &c; lea -5(a5),a0 ; load the effective address of c into a0 move.l a0,-4(a5) ; save that address in list ; ; c = ( list , *list ); move.l -4(a5),a0 ; [redundantly] get the address again move.b (a0),d0 ; move c into d0 ext.w d0 ; sign extend it to a word [?????] move.w d0,-5(a5) ; Whoops! This is a no no! ;} The assembler produced by compiling with +L is the same, except the offensive lines are: ; c = ( list , *list ); move.l -4(a5),a0 ; [redundantly] get the address again move.b (a0),d0 ; move c into d0 ext.w d0 ; sign extend it to a word [?????] ext.l d0 ; sign extend it to a long [2*?????] move.l d0,-5(a5) ; Even better... Perhaps gnucc should be ported to the Amiga, since presumably it compiles all the gnu stuff. Edwin