[Ada] Bootstrapping mainline GNAT fails

Zack Weinberg zack@codesourcery.com
Mon Mar 18 17:03:00 GMT 2002


On Mon, Mar 18, 2002 at 07:25:34PM -0500, Richard Kenner wrote:
>     I am using GNAT 3.14p to compile Ada sources, and GCC 2.95 to compile
>     C sources; the resulting object modules are then linked together to
>     make stage1/gnat1.  Is that what you mean by a kludged-up compiler?
> 
> No, I mean a gnat1 built using GCC 2.95 or 3.0 sources.  It indeed
> does not matter what is used to compile the C parts.

Ah, okay, I misunderstood.

To the best of my knowledge, the gnat1 I am using was built correctly;
however, I am still seeing a crash when the stage1 gnat1 tries to
build gnat1.adb.  It appears that Sem_Eval'Compile_Time_Known_Value
was miscompiled.

Breakpoint 4, 0x08277b74 in sem_eval__compile_time_known_value (op=2363) at ../../../../vanilla/gcc/ada/sem_eval.adb:739
739           if No (Op)

(gdb) disas $pc $pc+20
0x8277b74 <sem_eval__compile_time_known_value+116>:     call   *%esi
0x8277b76 <sem_eval__compile_time_known_value+118>:     mov    $0x1,%ebx
0x8277b7b <sem_eval__compile_time_known_value+123>:     test   %ebx,%ebx
0x8277b7d <sem_eval__compile_time_known_value+125>:     je     0x8277bdc <sem_eval__compile_time_known_value+220>
0x8277b7f <sem_eval__compile_time_known_value+127>:     mov    0xfffffff0(%ebp),%eax
0x8277b82 <sem_eval__compile_time_known_value+130>:     push   %eax
0x8277b83 <sem_eval__compile_time_known_value+131>:     call   0x81dde90 <system__soft_links__set_jmpbuf_address_soft>

(gdb) info registers
eax            0x8277b70        136805232
ecx            0xbffff248       -1073745336
edx            0xbffff320       -1073745120
ebx            0x0      0
esp            0xbffff308       0xbffff308
ebp            0xbffff348       0xbffff348
esi            0xbffff248       -1073745336
edi            0x0      0
eip            0x8277b74        0x8277b74
[etc]
(gdb) disas $esi $esi+20
Dump of assembler code from 0xbffff248 to 0xbffff25c:
0xbffff248:     jo     0xbffff23c
0xbffff24a:     (bad)  
0xbffff24b:     mov    $0xbffff270,%edi
0xbffff250:     div    0xfff32008(%ecx,%ecx,1),%eax
0xbffff257:     mov    $0x1,%edi
End of assembler dump.

I believe it's doing setup for the exception clause on the procedure:

   --  If we get an exception while trying to do this test, then some error
   --  has occurred, and we simply say that the value is not known after all

   exception
      when others =>
         return False;
   end Compile_Time_Known_Value;

It's not clear to me why this code would ever take an exception, though.

zw



More information about the Gcc mailing list