This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
gcc bug (Was: libgcj build crashes)
- To: gback at cs dot utah dot edu
- Subject: gcc bug (Was: libgcj build crashes)
- From: Anthony Green <green at cygnus dot com>
- Date: Wed, 9 Feb 2000 21:21:35 -0800
- CC: java-discuss at sourceware dot cygnus dot com, gcc-bugs at gcc dot gnu dot org
- References: <200002032255.PAA15348@peerless.cs.utah.edu>
- Reply-to: green at redhat dot com
Godmar wrote:
> With the current CVS of both gcc and libgcj, I'm getting the failure
> below when building libgcj. I'm building on a x86 box; the only option
> specified to both the egcs and the libgcj configure was a --prefix option.
Tonight Alex and I discovered that gcc was miscompiling the compiler.
We've verified this problem in gcc 2.7.2.3, but other notes in the
java-discuss thread imply that the problem continues to exist. I
think you said your bootstrapped snapshot has the same problem.
gcc/tree.c contains (around line 3147):
length = sizeof (struct tree_exp);
if (ggc_p)
t = ggc_alloc_tree (length);
else
{
t = (tree) obstack_alloc (obstack, length);
memset ((PTR) t, 0, length);
}
The compiler recognizes `memset' here and generates inline code. In
the particular buggy case we discovered, length is 96 but the inlined
code is only clearing out 94 bytes.
This confuses some other part of the compiler, resulting in the
failure you've reported.
As a work-around, try building GCC with -fno-builtin. The library's
memset will clear all 96 bytes.
AG
--
Anthony Green Red Hat
Sunnyvale, California