This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Ada sources kludge to get stage2 to succeed on x86-linux
- From: Laurent GUERBY <laurent at guerby dot net>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 29 Jun 2004 22:02:49 +0200
- Subject: Ada sources kludge to get stage2 to succeed on x86-linux
Just FYI, not suggesting to commit it :).
Without the two patches I get two ICEs "Invalid array index." from
tree-cfg.c:3226 on g-os_lib.adb and targparm.adb, here are the
corresponding debug_tree(t) outputs.
The second patch could probably be smaller, I tried the Index_First
trick last, may be removing Item, Arrow, Rname_Length and Index_Last
would still work, but since this is just for kludging I did not
dig further.
Thanks to #gcc people for helping out. Trying full bootstrap.
Laurent
(gdb) p debug_tree(t)
<array_ref 0x405e01e4
type <integer_type 0x402021d0 character asm_written unsigned QI
size <integer_cst 0x4018bf90 constant invariant 8>
unit size <integer_cst 0x4018be28 constant invariant 1>
user align 8 symtab 1075401892 alias set 13 precision 8 min <integer_cst 0x40201498 0> max <integer_cst 0x402014b0 255> RM size <integer_cst 0x4018bf90 8>
pointer_to_this <pointer_type 0x40202570 access_character>>
arg 0 <indirect_ref 0x405e1020
type <array_type 0x405d1658 gnat__os_lib__normalize_pathname__Tcur_dirS type <integer_type 0x402021d0 character>
nonaliased-component BLK size <var_decl 0x4062e000 iftmp.2170> unit size <var_decl 0x4062e244 iftmp.2175>
user align 8 symtab 0 alias set 3 domain <integer_type 0x405d1570>
pointer_to_this <pointer_type 0x405d189c> reference_to_this <reference_type 0x405d1828>>
arg 0 <var_decl 0x4063c740 cur_dir.2352 type <reference_type 0x405d1910>
readonly used unsigned ignored SI file /home/guerby/work/gcc/version-head/gcc/ada/g-os_lib.adb line 1766
size <integer_cst 0x4018be40 constant invariant 32>
unit size <integer_cst 0x4018bea0 constant invariant 4>
align 32 context <function_decl 0x4039ebc8 gnat__os_lib__normalize_pathname> chain <var_decl 0x4063c7b4 T.2353>>
/home/guerby/work/gcc/version-head/gcc/ada/g-os_lib.adb:1766>
arg 1 <var_decl 0x405d1414 R264b
type <integer_type 0x403bfa6c integer readonly SI
size <integer_cst 0x4018b9d8 constant invariant 32>
unit size <integer_cst 0x4018ba80 constant invariant 4>
align 32 symtab 0 alias set -1 precision 32 min <integer_cst 0x4018ba50 -2147483648> max <integer_cst 0x4018ba68 2147483647>>
readonly addressable ignored SI file /home/guerby/work/gcc/version-head/gcc/ada/g-os_lib.adb line 1703 size <integer_cst 0x4018b9d8 32> unit size <integer_cst 0x4018ba80 4>
align 32 context <function_decl 0x4039ebc8 gnat__os_lib__normalize_pathname>
chain <type_decl 0x405d14fc gnat__os_lib__normalize_pathname__TTcur_dirSP1___XD type <integer_type 0x405d1488 gnat__os_lib__normalize_pathname__TTcur_dirSP1___XD>
ignored VOID file /home/guerby/work/gcc/version-head/gcc/ada/g-os_lib.adb line 1703
align 1 context <function_decl 0x4039ebc8 gnat__os_lib__normalize_pathname> chain <type_decl 0x405d15e4>>>
arg 2 <var_decl 0x4062bb54 R263b.2160 type <integer_type 0x403bfa6c integer>
readonly used ignored SI file /home/guerby/work/gcc/version-head/gcc/ada/g-os_lib.adb line 1703 size <integer_cst 0x4018b9d8 32> unit size <integer_cst 0x4018ba80 4>
align 32 context <function_decl 0x4039ebc8 gnat__os_lib__normalize_pathname>
chain <var_decl 0x4062bbc8 R264b.2161 type <integer_type 0x403bfa6c integer>
readonly used ignored SI file /home/guerby/work/gcc/version-head/gcc/ada/g-os_lib.adb line 1766 size <integer_cst 0x4018b9d8 32> unit size <integer_cst 0x4018ba80 4>
align 32 context <function_decl 0x4039ebc8 gnat__os_lib__normalize_pathname> chain <var_decl 0x4062bc3c T.2162>>>
/home/guerby/work/gcc/version-head/gcc/ada/g-os_lib.adb:1766>
$8 = void
(gdb) p debug_tree(t)
<array_range_ref 0x40551e70
type <array_type 0x405587b4 targparm__get_target_parameters__T123b
type <integer_type 0x402021d0 character asm_written unsigned QI
size <integer_cst 0x4018bf90 constant invariant 8>
unit size <integer_cst 0x4018be28 constant invariant 1>
user align 8 symtab 1075401892 alias set -1 precision 8 min <integer_cst 0x40201498 0> max <integer_cst 0x402014b0 255> RM size <integer_cst 0x4018bf90 8>
pointer_to_this <pointer_type 0x40202570 access_character>>
nonaliased-component BLK
size <var_decl 0x4059ed98 iftmp.178 type <integer_type 0x4018f984 bit_size_type>
used ignored DI file /home/guerby/work/gcc/version-head/gcc/ada/targparm.adb line 310
size <integer_cst 0x4018bd08 constant invariant 64>
unit size <integer_cst 0x4018bdf8 constant invariant 8>
align 64 context <function_decl 0x404c7d98 targparm__get_target_parameters> chain <var_decl 0x4059ee0c iftmp.179>>
unit size <var_decl 0x405a1000 iftmp.183 type <integer_type 0x4018f910 long int>
used ignored SI file /home/guerby/work/gcc/version-head/gcc/ada/targparm.adb line 310
size <integer_cst 0x4018b9d8 constant invariant 32>
unit size <integer_cst 0x4018ba80 constant invariant 4>
align 32 context <function_decl 0x404c7d98 targparm__get_target_parameters> chain <var_decl 0x405a115c T.184>>
user align 8 symtab 0 alias set 6
domain <integer_type 0x405586cc type <integer_type 0x4018f910 long int>
SI size <integer_cst 0x4018b9d8 32> unit size <integer_cst 0x4018ba80 4>
align 32 symtab 0 alias set -1 precision 32 min <var_decl 0x4059e984 R120b.169> max <var_decl 0x4059ea6c iftmp.171> index type <integer_type 0x405585e4 targparm__get_target_parameters__T122b___XD>>
pointer_to_this <pointer_type 0x405a1244>>
arg 0 <indirect_ref 0x4055a1a0
type <array_type 0x404c7570 types__big_source_buffer type <integer_type 0x402021d0 character>
asm_written nonaliased-component BLK
size <integer_cst 0x404c8540 constant invariant public static overflow 0xfffffffc00000000>
unit size <integer_cst 0x404c8570 constant invariant public static overflow -2147483648>
user align 8 symtab 1078717932 alias set 6 domain <integer_type 0x404c7488>
pointer_to_this <pointer_type 0x404c7828 types__source_buffer_ptr>>
arg 0 <parm_decl 0x404c79f8 system_text type <pointer_type 0x404c7984 types__source_buffer_ptr>
readonly unsigned SI file /home/guerby/work/gcc/version-head/gcc/ada/targparm.ads line 590
size <integer_cst 0x4018be40 constant invariant 32>
unit size <integer_cst 0x4018bea0 constant invariant 4>
align 32 context <function_decl 0x404c7d98 targparm__get_target_parameters> result <pointer_type 0x404c7984 types__source_buffer_ptr> initial <pointer_type 0x404c7984 types__source_buffer_ptr> arg-type <pointer_type 0x404c7984 types__source_buffer_ptr> arg-type-as-written <pointer_type 0x404c7984 types__source_buffer_ptr> chain <parm_decl 0x404c7c3c source_first>>
/home/guerby/work/gcc/version-head/gcc/ada/targparm.adb:310>
arg 1 <var_decl 0x405584fc R120b
type <integer_type 0x4053589c types__Ttext_ptrB readonly SI size <integer_cst 0x4018be40 32> unit size <integer_cst 0x4018bea0 4>
user align 32 symtab 0 alias set -1 precision 32 min <integer_cst 0x404c2840 -2147483648> max <integer_cst 0x404c2858 2147483647> RM size <integer_cst 0x4018be40 32>>
readonly addressable ignored SI file /home/guerby/work/gcc/version-head/gcc/ada/targparm.adb line 310 size <integer_cst 0x4018be40 32> unit size <integer_cst 0x4018bea0 4>
align 32 context <function_decl 0x404c7d98 targparm__get_target_parameters>
chain <var_decl 0x40558570 R121b type <integer_type 0x4053589c types__Ttext_ptrB>
readonly addressable ignored SI file /home/guerby/work/gcc/version-head/gcc/ada/targparm.adb line 310 size <integer_cst 0x4018be40 32> unit size <integer_cst 0x4018bea0 4>
align 32 context <function_decl 0x404c7d98 targparm__get_target_parameters> chain <type_decl 0x40558658 targparm__get_target_parameters__T122b___XD>>>
/home/guerby/work/gcc/version-head/gcc/ada/targparm.adb:310>
$2 = void
Index: targparm.adb
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/targparm.adb,v
retrieving revision 1.11
diff -u -r1.11 targparm.adb
--- targparm.adb 25 Jun 2004 16:39:33 -0000 1.11
+++ targparm.adb 29 Jun 2004 19:53:31 -0000
@@ -292,9 +292,13 @@
Ploop : for K in All_Parameter_Restrictions loop
declare
+ Arrow : constant Text_Buffer := " => ";
+ Item : Text_Buffer (1 .. 4);
Rname : constant String :=
All_Parameter_Restrictions'Image (K);
-
+ Rname_Length : constant Source_Ptr := Rname'Length;
+ Index_First : constant Source_Ptr := P + Rname_Length;
+ Index_Last : constant Source_Ptr := P + Rname_Length + 3;
V : Natural;
-- Accumulates value
@@ -307,9 +311,9 @@
end if;
end loop;
- if System_Text (P + Rname'Length .. P + Rname'Length + 3) =
- " => "
- then
+ Item := System_Text
+ (Index_First .. Index_Last);
+ if Item = Arrow then
P := P + Rname'Length + 4;
V := 0;
Index: g-os_lib.adb
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ada/g-os_lib.adb,v
retrieving revision 1.14
diff -u -r1.14 g-os_lib.adb
--- g-os_lib.adb 25 Jun 2004 16:39:27 -0000 1.14
+++ g-os_lib.adb 29 Jun 2004 19:54:48 -0000
@@ -1763,7 +1763,12 @@
-- Back to where we were before
- Cur_Dir (Cur_Dir'Last) := ASCII.NUL;
+ declare
+ Last_Index : constant Natural := Cur_Dir'Last;
+ begin
+ -- Cur_Dir (Cur_Dir'Last) := ASCII.NUL;
+ Cur_Dir (Last_Index) := ASCII.NUL;
+ end;
Status := Change_Dir (Cur_Dir);
end if;
end;