This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: bootstrap error on m68k-linux with CVS HEAD 20020127
- From: Roman Zippel <zippel at linux-m68k dot org>
- To: Matthias Klose <doko at cs dot tu-berlin dot de>
- Cc: <gcc-bugs at gcc dot gnu dot org>, <gcc-patches at gcc dot gnu dot org>, <gcc at gnu dot org>
- Date: Mon, 28 Jan 2002 13:58:41 +0100 (CET)
- Subject: Re: bootstrap error on m68k-linux with CVS HEAD 20020127
Hi,
On Mon, 28 Jan 2002, Matthias Klose wrote:
> stage1/xgcc -Bstage1/ -B/usr/lib/gcc-snapshot/m68k-linux/bin/ -DIN_GCC -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I. -I../../src/gcc -I../../src/gcc/. -I../../src/gcc/config -I../../src/gcc/../include -c ../../src/gcc/c-parse.c -o c-parse.o
>
> /usr/share/bison/bison.simple:237: internal error: Segmentation fault
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
>
> adding -save-temps lets the compilation succeed.
>
> [..]
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x8000a53e in pushdecl (x=0xc012fc78) at ../../src/gcc/c-decl.c:2311
> 2311 if (decl && ! comptypes (TREE_TYPE (x), TREE_TYPE (decl))
> (gdb) p x
> $1 = 0xc012fc78
> (gdb) p decl
> $2 = 0xc01b
Did you disable checking? It crashed much earlier in my case due to
poisoning, so I didn't know it was the same problem. The problem is that
too little memory is allocated for an identifier. struct lang_identifier
is 58 bytes long but only 56 bytes are allocated because of rounding. The
patch below fixes this, although I'd prefer struct cpp_hashnode would
have better alignment.
Bootstrapped and tested only on i686-linux, on m68k-linux it does
bootstrap but I haven't run the tests yet.
2002-01-28 Roman Zippel <zippel@linux-m68k.org>
* toplev.c (lang_independent_init): round up identifier size
Index: gcc/toplev.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/toplev.c,v
retrieving revision 1.572
diff -u -r1.572 toplev.c
--- toplev.c 2002/01/23 18:48:13 1.572
+++ toplev.c 2002/01/27 22:18:52
@@ -5012,8 +5012,8 @@
/* Set the language-dependent identifier size. */
tree_code_length[(int) IDENTIFIER_NODE]
- = ((lang_hooks.identifier_size - sizeof (struct tree_common))
- / sizeof (tree));
+ = ((lang_hooks.identifier_size - sizeof (struct tree_common)
+ + sizeof (tree) - 1) / sizeof (tree));
/* Initialize the garbage-collector, and string pools. */
init_ggc ();