Path: utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!APPLE.COM!satyr!kayvan From: satyr!kayvan@APPLE.COM (Kayvan Sylvan) Newsgroups: gnu.gcc.bug Subject: GCC 1.31 - i386 optimization bug Message-ID: <8811301842.AA03049@satyr.UUCP> Date: 1 Dec 88 02:42:35 GMT Sender: daemon@tut.cis.ohio-state.edu Reply-To: satyr!kayvan@apple.com Distribution: gnu Organization: GNUs Not Usenet Lines: 45 I just brought up GNU Emacs 18.52 on my Altos 1000 386 System V.3 box using GCC 1.31. (Hooray!!!) The only problem I had was in compiling search.c. I was using the optimizer thus: % gcc -O -Demacs -c search.c Assembler: search.c aline 1358 : syntax error aline 1840 : syntax error The same line without the -O flag works. (I ended up with un-optimized search.o linked with the rest of the code optimized). Here's the output from `gcc -v -S -Demacs search.c': % gcc -v -S -O -Demacs search.c gcc version 1.31 /usr/local/lib/gcc-cpp -v -Demacs -undef -D__GNU__ -D__GNUC__ -Dunix -Di386 -D__OPTIMIZE__ search.c /tmp/cca03030.cpp GNU CPP version 1.31 /usr/local/lib/gcc-cc1 /tmp/cca03030.cpp -quiet -dumpbase search.c -O -version -o search.s GNU C version 1.31 (80386, ATT syntax) compiled by GNU C version 1.31. Looking in search.s I find the two offending lines are imull with the wrong number of args: ------------------------ first mistake --------------------------------- negl %eax imull -8(%ebp),%eax,%eax /* Line 1358 - imull with 3 args */ jmp .L154 .L211: movl Qnil,%ecx ------------------------ second mistake --------------------------------- movl -8(%ebp),%eax negl %eax imull -76(%ebp),%eax,%eax /* Line 1840 - imull with 3 args */ .L154: leal -92(%ebp),%esp popl %edi -------------------------- That's all folks ----------------------------- I can send the whole of search.s to whoever wants to investigate this problem. ---Kayvan