------- Additional Comments From ro at techfak dot uni-bielefeld dot de 2005-07-05 17:04 ------- Subject: Re: [4.0/4.1 Regression] Cannot build gnattools on Tru64 UNIX V5.1B
charlet at gcc dot gnu dot org writes: > Given your last comment (a variable set to 4), it still looks very much like > a codegen issue to me, and likely target dependent. > > I guess a next step could be to either look at the ssa transformations > performed, > and/or at the assembly code generated for the elab routine. I've approached this a bit differently: * I tried to bootstrap mainline with -O0, but it failed as before and even an almost current CVS gdb just SEGVs on the gnatmake binary ;-( * On the 4.0 branch, a bootstrap with -O0 also failed as before, but at least I can debug the gnatmake binary: osint__running_programs starts as 0, is later initialized to 2 (osint__make) in osint__set_program and again overwritten to 4 (osint__unspecified) in osint___elabb: Breakpoint 4, osint.set_program (p=16) at /vol/gnu/src/gcc/gcc-4.0-branch-dist/gcc/ada/osint.adb:2274 (gdb) p osint__running_program $6 = 0 (gdb) where #0 osint.set_program (p=16) at /vol/gnu/src/gcc/gcc-4.0-branch-dist/gcc/ada/osint.adb:2274 #1 0x00000001201fbf10 in <osint__m___elabb> () at /vol/gnu/src/gcc/gcc-4.0-branch-dist/gcc/ada/osint-m.adb:49 #2 0x00000001200b7750 in adainit () at b_gnatm.c:562 #3 0x00000001200b8aec in main (argc=536854608, argv=0x0, envp=0x0) at b_gnatm.c:733 #4 0x00000001200b617c in __start () (gdb) cont Continuing. Watchpoint 6: {<data variable, no debug info>} 5369590752 Old value = 0 New value = 2 osint.set_program (p=16) at /vol/gnu/src/gcc/gcc-4.0-branch-dist/gcc/ada/osint.adb:2280 (gdb) cont Continuing. Breakpoint 3, <osint___elabb> () at /vol/gnu/src/gcc/gcc-4.0-branch-dist/gcc/ada/osint.adb:45 (gdb) cont Continuing. Watchpoint 6: {<data variable, no debug info>} 5369590752 Old value = 2 New value = 4 <osint___elabb> () at /vol/gnu/src/gcc/gcc-4.0-branch-dist/gcc/ada/osint.adb:48 (gdb) where #0 <osint___elabb> () at /vol/gnu/src/gcc/gcc-4.0-branch-dist/gcc/ada/osint.adb:48 #1 0x00000001200b7cc0 in adainit () at b_gnatm.c:610 #2 0x00000001200b8aec in main (argc=536854608, argv=0x0, envp=0x0) at b_gnatm.c:733 #3 0x00000001200b617c in __start () * On the 3.4 branch, osint__running_program is statically initialized to osint__unspecified in osint.adb, later reset to osint__make in osint__set_program: Old value = {F = osint__unspecified} New value = {F = osint__make} osint__set_program (p=osint__make) at /vol/gnu/src/gcc/gcc-3.4-branch-dist/gcc/ada/osint.adb:2253 Breakpoint 3, osint.set_program (p=osint__make) at /vol/gnu/src/gcc/gcc-3.4-branch-dist/gcc/ada/osint.adb:2247 (gdb) where #0 osint.set_program (p=osint__make) at /vol/gnu/src/gcc/gcc-3.4-branch-dist/gcc/ada/osint.adb:2247 #1 0x000000012019efe8 in <osint__m___elabb> () at /vol/gnu/src/gcc/gcc-3.4-branch-dist/gcc/ada/osint-m.adb:49 #2 0x00000001200a046c in adainit () at b_gnatm.c:267 #3 0x00000001200a11c0 in main (argc=6, argv=0x11fffc018, envp=0x11fffc050) at b_gnatm.c:389 #4 0x000000012009fc3c in __start () $1 = {F = osint__unspecified} (gdb) cont Continuing. Watchpoint 5: osint.running_program Old value = {F = osint__unspecified} New value = {F = osint__make} osint.set_program (p=osint__make) at /vol/gnu/src/gcc/gcc-3.4-branch-dist/gcc/ada/osint.adb:2253 Thus, the way/order of initialization changed between 3.4 and 4.0, causing the observed failure: * from osint.adb: package body Osint is Running_Program : Program_Type := Unspecified; -- comment required here ??? * from osint-m.adb: package body Osint.M is [...] begin Set_Program (Make); end Osint.M; * in 3.4: osint__running_program = osint__unspecified (4) statically (osint.o) osint__running_program = osint__make (2) in osint.set_program, called from osint__m___elabb (osint_m.o) * in 4.0: osint__running_program = 0 statically (osint.o) osint__running_program = osint__make (2) in osint.set_program, called from osint__m___elabb (osint_m.o) osint__running_program = osint__unspecified (4) in osint___elabb (osint.o) Hope this helps to narrow down the root cause. Rainer -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18434