egcs-1.1.1 bootstrap-failure on i386-next-nextstep3

Horst von Brand vonbrand@inf.utfsm.cl
Fri Dec 11 12:40:00 GMT 1998


Eric Norum <eric@skatter.usask.ca> said:
> I've discovered what's going wrong with egcs-1.1.1 on OPENSTEP/Intel.
> 
> Symptoms
> ========
> The gencheck program compiled with stage1/xgcc does not run  
> (Segmentation fault).
> 
> 
> Investigation
> =============
> A little poking with gdb shows that the program is dying on line 53:
> 53        for (i = 0; tree_codes[i]; i++)
> 
> Disassembling the instructions shows:
> 0x291e <main+34>:       addl    $0x04,%esp
> 0x2921 <main+37>:       cmpl    $0x00,tree_codes
> 0x2928 <main+44>:       je      0x00002957
> 0x292a <main+46>:       movl    $tree_codes,%ebx
> 0x292f <main+51>:       addb    %cl,0x68505003(%ebx)  <<=== ???
> 0x2935 <main+57>:       pushal
> 0x2936 <main+58>:       aas
> 
> Total garbage!
> 
> 
> Identification
> ==============
> Looking at the assembler code generated by the stage 1 compiler reveals:
>         .stabd 68,0,53
>         addl $4,%esp
>         cmpl $0,_tree_codes
>         je L95
>         movl $_tree_codes,%ebx
>         .align 2                   <<<<<======= !!!!!!!!!!!
> L97:
>         .stabd 68,0,55
>         movl (%ebx),%eax
>         pushl %eax
>         pushl %eax
> 
> What's an `align' doing in the middle of an instruction  
> sequence??!!!  It's forcing an extra byte between the end of the  
> `movl $_tree_codes,%ebx' instruction and the beginning of the `movl  
> (%ebx),%eax' instruction.  This, of course, completely messes up the  
> instructions seen by the processor.

This is OK, it is trying to align the L97 optimally. What is broken is your
assembler, it should put out NOPs there, not thrash the instruction. What
assembler are you using? Perhaps you should try installing GNU as + ld.
-- 
Dr. Horst H. von Brand                       mailto:vonbrand@inf.utfsm.cl
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513



More information about the Gcc-bugs mailing list