mtsu@blake.acs.washington.edu (Montana State) (05/03/89)
I'm trying to compile compress 4.0 with gcc 1.35, but I'm getting an illegal instruction from an asm directive. Hardware: mVAX II OS: Ultrix 2.3 Here's a brief look at what'sa goin on. caesar # gcc -g compress.c -o compressnew caesar # gdb compressnew GDB 3.1, Copyright (C) 1988 Free Software Foundation, Inc. Reading symbol data from /user0/local/src/compress4.0/compressnew...done. (gdb) r compressnew test2 Starting program: /user0/local/src/compress4.0/compressnew compressnew test2 compressnew.Z already exists; do you wish to overwrite compressnew.Z (y or n)? y Program received signal 4, Illegal instruction output (code=11) (compress.c line 878) 878 asm( "insv 4(ap),r11,r10,(r9)" ); (gdb) list 873 * 874 * Translation: Insert BITS bits from the argument starting at 875 * offset bits from the beginning of buf. 876 */ 877 0; /* Work around for pcc -O bug with asm and if stmt */ 878 asm( "insv 4(ap),r11,r10,(r9)" ); 879 #else /* not a vax */ 880 /* 881 * byte/bit numbering on the VAX is simulated by the following code 882 */ It it me?? or is it GCC??
grunwald@flute.cs.uiuc.edu (05/03/89)
I conjecture that this is a problem with using an asm() designed for an old compiler, and that gnu C is doing register optimization & stepping on things the previous asm() thought were safe. Perhaps the form ``asm("a single string")'' should raise a suppresible warning, since these tend to be non-GNU asm()'s. -- Dirk Grunwald Univ. of Illinois grunwald@flute.cs.uiuc.edu