This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gcc bug (Was: libgcj build crashes)



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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]