This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Gcc mainline failed to bootstrap on Linux/ia64
> Jan Hubicka <hubicka@ucw.cz> writes:
>
> >> Gcc mainline on Sat Sep 6 07:08:21 PDT 2003 failed to bootstrap on
> >> Linux/ia64. I got
> >>
> >> In file included from /net/gnu/export/gnu/src/gcc/gcc/libjava/include/jvm.h:23,
> >> from /net/gnu/export/gnu/src/gcc/gcc/libjava/exception.cc:22:
> >> ./include/java-threads.h:228: internal compiler error: Segmentation fault
> >> Please submit a full bug report,
> >> with preprocessed source if appropriate.
> >> See <URL:http://gcc.gnu.org/bugs.html> for instructions.
> >
> > This appears to be related to change of mine to notice_global_symbol.
> > I just commited fix to different problem that may fix it. Can you
> > please ensure that the following patch is in your tree?
> > * cgraph.c (cgraph_mark_reachable_node): Only enqueue finalized functions.
> > (cgraph_varpool_finalize_decl): Notice global symbol when needed.
>
> This is still not fixed.
>
> $ gdb --args /tmp/cvs/gcc-20030908/Build/gcc/cc1plus -quiet -nostdinc++ -v -I. -I../../../libjava -I./include -I./gcj -I../../../libjava -Iinclude -I../../../libjava/include -I/tmp/cvs/gcc-20030908/boehm-gc/include -I../../../libjava/libltdl -I../../../libjava/libltdl -I../../../libjava/.././libjava/../gcc -I../../../libjava/../libffi/include -I../libffi/include -iprefix /tmp/cvs/gcc-20030908/Build/gcc/../lib/gcc/ia64-suse-linux/3.4/ -isystem /tmp/cvs/gcc-20030908/Build/gcc/include -isystem /usr/local/ia64-suse-linux/bin/include -isystem /usr/local/ia64-suse-linux/lib/include -D_GNU_SOURCE -DHAVE_CONFIG_H -DGC_LINUX_THREADS=1 -D_REENTRANT=1 -DTHREAD_LOCAL_ALLOC=1 -DSILENT=1 -DNO_SIGNALS=1 -DNO_EXECUTE_PERMISSION=1 -DALL_INTERIOR_POINTERS=1 -DJAVA_FINALIZATION=1 -DGC_GCJ_SUPPORT=1 -DATOMIC_UNCOLLECTABLE=1 -D_GNU_SOURCE -DPREFIX="/usr/local" -DLIBDIR="/usr/local/lib" -DBOOT_CLASS_PATH="/usr/local/share/java/libgcj-3.4.jar" -D_GNU_SOURCE -DPIC -isystem /usr/local/ia64-suse-linux
> /include -isystem /usr/local/ia64-suse-linux/sys-include -MD .deps/prims.pp ../../../libjava/prims.cc -quiet -dumpbase prims.cc -auxbase-strip .libs/prims.o -g -g -O2 -O2 -O2 -Wswitch-enum -W -Wall -version -fno-rtti -fnon-call-exceptions -fdollars-in-identifiers -funwind-tables -fPIC -o /tmp/cc7t0b1y.s
> GNU gdb 5.3.90_2003-07-16-cvs
> Copyright 2003 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for details.
> This GDB was configured as "ia64-suse-linux"...
> (gdb) r
> Starting program: /tmp/cvs/gcc-20030908/Build/gcc/cc1plus -quiet -nostdinc++ -v -I. -I../../../libjava -I./include -I./gcj -I../../../libjava -Iinclude -I../../../libjava/include -I/tmp/cvs/gcc-20030908/boehm-gc/include -I../../../libjava/libltdl -I../../../libjava/libltdl -I../../../libjava/.././libjava/../gcc -I../../../libjava/../libffi/include -I../libffi/include -iprefix /tmp/cvs/gcc-20030908/Build/gcc/../lib/gcc/ia64-suse-linux/3.4/ -isystem /tmp/cvs/gcc-20030908/Build/gcc/include -isystem /usr/local/ia64-suse-linux/bin/include -isystem /usr/local/ia64-suse-linux/lib/include -D_GNU_SOURCE -DHAVE_CONFIG_H -DGC_LINUX_THREADS=1 -D_REENTRANT=1 -DTHREAD_LOCAL_ALLOC=1 -DSILENT=1 -DNO_SIGNALS=1 -DNO_EXECUTE_PERMISSION=1 -DALL_INTERIOR_POINTERS=1 -DJAVA_FINALIZATION=1 -DGC_GCJ_SUPPORT=1 -DATOMIC_UNCOLLECTABLE=1 -D_GNU_SOURCE -DPREFIX=/usr/local -DLIBDIR=/usr/local/lib -DBOOT_CLASS_PATH=/usr/local/share/java/libgcj-3.4.jar -D_GNU_SOURCE -DPIC -isystem /usr/local/ia64-suse-linux/
> include -isystem /usr/local/ia64-suse-linux/sys-include -MD .deps/prims.pp ../../../libjava/prims.cc -quiet -dumpbase prims.cc -auxbase-strip .libs/prims.o -g -g -O2 -O2 -O2 -Wswitch-enum -W -Wall -version -fno-rtti -fnon-call-exceptions -fdollars-in-identifiers -funwind-tables -fPIC -o /tmp/cc7t0b1y.s
> ignoring nonexistent directory "/usr/local/ia64-suse-linux/bin/include"
> ignoring nonexistent directory "/usr/local/ia64-suse-linux/lib/include"
> ignoring nonexistent directory "/usr/local/ia64-suse-linux/include"
> ignoring nonexistent directory "/usr/local/ia64-suse-linux/sys-include"
> ignoring nonexistent directory "/tmp/cvs/gcc-20030908/Build/gcc/../lib/gcc/ia64-suse-linux/3.4/include"
> ignoring nonexistent directory "/tmp/cvs/gcc-20030908/Build/gcc/../lib/gcc/ia64-suse-linux/3.4/../../../../ia64-suse-linux/include"
> ignoring nonexistent directory "NONE/include"
> ignoring nonexistent directory "/usr/local/lib/gcc/ia64-suse-linux/3.4/include"
> ignoring nonexistent directory "/usr/local/lib/../ia64-suse-linux/include"
> ignoring duplicate directory "../../../libjava"
> ignoring duplicate directory "include"
> ignoring duplicate directory "../../../libjava/libltdl"
> #include "..." search starts here:
> #include <...> search starts here:
> .
> ../../../libjava
> ./include
> ./gcj
> ../../../libjava/include
> /tmp/cvs/gcc-20030908/boehm-gc/include
> ../../../libjava/libltdl
> ../../../libjava/.././libjava/../gcc
> ../../../libjava/../libffi/include
> ../libffi/include
> /tmp/cvs/gcc-20030908/Build/gcc/include
> /usr/local/include
> /usr/include
> End of search list.
> GNU C++ version 3.4 20030908 (experimental) (ia64-suse-linux)
> compiled by GNU C version 3.4 20030908 (experimental).
> GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
>
> Program received signal SIGSEGV, Segmentation fault.
> notice_global_symbol (decl=0x2000000000b7a2f0) at ../../gcc/varasm.c:1061
> 1061 p = (* targetm.strip_name_encoding) (XSTR (XEXP (decl_rtl, 0), 0));
> (gdb) bt
> #0 notice_global_symbol (decl=0x2000000000b7a2f0) at ../../gcc/varasm.c:1061
> #1 0x4000000000779360 in cgraph_varpool_mark_needed_node (
> node=0x2000000000ad9980) at ../../gcc/cgraph.c:475
> #2 0x40000000006e0d60 in rest_of_decl_compilation (decl=0x2000000000b7a2f0,
> asmspec=0x600000000015c178 "r13", top_level=1, at_end=0)
> at ../../gcc/toplev.c:1912
> #3 0x400000000008e5b0 in cp_finish_decl (decl=0x2000000000b7a2f0, init=0x0,
> asmspec_tree=0x2000000000ad9980, flags=9470730) at ../../gcc/cp/decl.c:7805
> #4 0x400000000019b730 in cp_parser_init_declarator (
> parser=0x20000000003e37a0, decl_specifiers=0x2000000000b85830,
> prefix_attributes=0x60000fffffffa411, function_definition_allowed_p=false,
> member_p=false, declares_class_or_enum=0,
> function_definition_p=0x60000fffffffa420) at ../../gcc/cp/parser.c:9486
> #5 0x4000000000779360 in cgraph_varpool_mark_needed_node (
> node=0x20000000003e37a0) at ../../gcc/cgraph.c:475
> #6 0x2000000000b85830 in ?? ()
> #7 0x4000000000779360 in cgraph_varpool_mark_needed_node (node=Cannot access memory at address 0x60000fff7fffffe0
> )
> at ../../gcc/cgraph.c:475
> Cannot access memory at address 0x60000fff7ffffff0
> (gdb) pt decl
> <var_decl 0x2000000000b7a2f0 _Jv_self
> type <integer_type 0x20000000004362f0 size_t unsigned asm_written DI
> size <integer_cst 0x200000000031cb70 constant 64>
> unit size <integer_cst 0x200000000031ccc0 constant 8>
> align 64 symtab 4077552 alias set -1 precision 64 min <integer_cst 0x200000000031cd50 0> max <integer_cst 0x200000000031cd80 18446744073709551615>
> pointer_to_this <pointer_type 0x20000000009c11e0>>
> unsigned public static tree_1 regdecl decl_4 DI file ./include/java-threads.h line 228 size <integer_cst 0x200000000031cb70 64> unit size <integer_cst 0x200000000031ccc0 8>
> align 64
> (reg/v:DI 13 r13 [ _Jv_self ]) chain <type_decl 0x2000000000b79e10 _Jv_ThreadId_t>>
The problem obviously is that we see global variable placed in register.
I am quite surprised to see this in java, but the attached patch should
help. Can you, please try it out?
Sorry for the delay - bit too many problems to deal with at once :(
Tue Sep 9 02:03:42 CEST 2003 Jan Hubicka <jh@suse.cz>
* varasm.c (notice_global_symbol): Fix dealing with registers.
Index: varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.381
diff -c -3 -p -r1.381 varasm.c
*** varasm.c 5 Sep 2003 04:24:26 -0000 1.381
--- varasm.c 9 Sep 2003 00:03:31 -0000
*************** notice_global_symbol (tree decl)
*** 1058,1063 ****
--- 1058,1066 ----
char *name;
rtx decl_rtl = DECL_RTL (decl);
+ if (GET_CODE (decl_rtl) == REG)
+ return;
+
p = (* targetm.strip_name_encoding) (XSTR (XEXP (decl_rtl, 0), 0));
name = xstrdup (p);