This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
cc1 segfaults during bootstrap on ARM...
- To: gcc bugs list <gcc-bugs at gcc dot gnu dot org>
- Subject: cc1 segfaults during bootstrap on ARM...
- From: Scott Bambrough <scottb at netwinder dot org>
- Date: Mon, 01 May 2000 19:19:26 -0400
- Organization: Rebel.com
The current mainline compiler segfaults during the bootstrap of the compiler.
[scottb@dirac gcc]$ ./xgcc -v
Using builtin specs.
gcc version 2.96 20000501 (experimental)
[scottb@dirac gcc]$ uname -a
Linux dirac 2.2.14-20000317 #1 Sat Mar 25 07:39:52 EST 2000 armv4l unknown
I configured with the following:
CFLAGS="-g -O0" ../gcc-2.96/configure --host=armv4l-unknown-linux-gnu
--with-cpu=strongarm --enable-shared
When I do a `make bootstrap-lean` it fails with the following error:
for name in _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 _lshrdi3
_ashldi3 _ashrdi3 _ffsdi2 _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2
_floatdidf _floatdisf _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi
_fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi _fixtfdi
_fixunstfdi _floatditf __gcc_bcmp _varargs __dummy _eprintf _bb _shtab
_clear_cache _trampoline __main _exit _ctors _pure; \
do \
echo ${name}; \
./xgcc -B/usr/local/armv4l-unknown-linux-gnu/bin/ -B./
-isystem /usr/local/armv4l-unknown-linux-gnu/include -O2
-DIN_GCC -W -Wall -Wtraditional -O2 -g -O0 -isystem ./include
-fomit-frame-pointer -fPIC -g0 -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED -I. -I../../gcc-2.96/gcc
-I../../gcc-2.96/gcc/config -I../../gcc-2.96/gcc/../include
-c -DL${name} \
../../gcc-2.96/gcc/libgcc2.c -o ${name}.o; \
if [ $? -eq 0 ] ; then true; else exit 1; fi; \
ar rc tmplibgcc2.a ${name}.o; \
rm -f ${name}.o; \
done
_muldi3
xgcc: Internal compiler error: program cc1 got fatal signal 11
make[4]: *** [libgcc2.a] Error 1
make[4]: Leaving directory `/home/scottb/cvstree/gcc-2.96-build/gcc'
cc1 fails running this command line:
./cc1 libgcc2.i -quiet -dumpbase libgcc2.c -g -g0 -O2 -O2 -O0 -W -Wall
-Wtraditional -version -fomit-frame-pointer -fPIC -o libgcc2.s
cc1: memory violation at pc=0x0227a10c, lr=0x022723b0 (bad
address=0x2f636377, code 0)
Running under GDB and looking at frame 0 on the stack:
(gdb) frame 0
#0 poplevel (keep=0, reverse=0, functionbody=0)
at ../../gcc-2.96/gcc/c-decl.c:1052
1052 if (block_previously_created)
(gdb) l
1047 or if this level is a function body,
1048 create a BLOCK to record them for the life of this function.
*/
1049
1050 block = 0;
1051 block_previously_created = (current_binding_level->this_block !=
0);
1052 if (block_previously_created)
1053 block = current_binding_level->this_block;
1054 else if (keep || functionbody
1055 || (current_binding_level->keep_if_subblocks && subblocks
!=
0))
1056 block = make_node (BLOCK);
(gdb) l
1057 if (block != 0)
1058 {
1059 BLOCK_VARS (block) = decls;
1060 BLOCK_SUBBLOCKS (block) = subblocks;
1061 }
The code segfaults on line 1059.
(gdb) p block
$6 = 0x2f636367
(gdb) p *block
Cannot access memory at address 0x2f636367
The address contained in block is invalid. It is set on line 1053 based on
a value read from current_binding_level.
(gdb) p *current_binding_level
$4 = {names = 0x0, tags = 0x0, shadowed = 0x0, blocks = 0x0,
this_block = 0x2f636367, level_chain = 0x23094f8, parm_flag = 1 '\001',
tag_transparent = 0 '\000', subblocks_tag_transparent = 47 '/',
keep = 0 '\000', keep_if_subblocks = 0 '\000', n_incomplete = 1768697197,
parm_order = 0x0}
(gdb) p *current_binding_level->level_chain
$9 = {names = 0x40111b00, tags = 0x0, shadowed = 0x0, blocks = 0x0,
this_block = 0x0, level_chain = 0x0, parm_flag = 0 '\000',
tag_transparent = 0 '\000', subblocks_tag_transparent = 0 '\000',
keep = 0 '\000', keep_if_subblocks = 0 '\000', n_incomplete = 1,
parm_order = 0x0}
It looks to me like current_binding_level is incorrect here. Am I on the
right track?
Scott
--
Scott Bambrough - Software Engineer
REBEL.COM http://www.rebel.com
NetWinder http://www.netwinder.org
libgcc2.i.gz