Segfault in libjava/ while compiling gcj

Wed May 18 10:38:43 GMT 2022

I'm unable to use the system g++ to compile it as removing any of the
includes breaks it, removing any of the -B arguments breaks it, but not
removing the -B arguments break it. Not exactly sure how to compile a
preprocessed file either. As it stands, I have been unable to reproduce the
error or change any of the flags, although I have been able to produce a
preprocessed file as per your instructions.

On Wed, May 18, 2022 at 7:59 PM Xi Ruoyao <> wrote:

> On Wed, 2022-05-18 at 19:23 +1000, Zopolis0 via Gcc-help wrote:
> /* snip */
> > ../../../../gcj/libjava/ internal compiler error:
> > Segmentation fault
> /* snip */
> > Is this an error within
> No.  No matter is erroneous or not, the compiler should not
> crash.
> > Or is it catching an error from somewhere else?
> It indicates a bug in the compiler.
> > Should I report this as per the instructions?
> Maybe.  We don't know if you introduced the bug or the bug has been
> already in GCC trunk.
> Try to get a preprocessed file (by changing "-c" to "-E" in the command
> line, and "-o prims.o" to "-o prims.ii").  Then compile prims.ii using
> *unmodified and latest* g++ trunk with all flags (esp. -m32, -Ox, and -
> f...) in the command line.  But "-D...", "-I...", and "-B..." shall be
> removed.
> If the segfault can be reproduced with unmodified g++ trunk with the
> instruction above, try to remove some flags (for example, remove -m32,
> change -O2 to -O1 or -O0, etc) and get a minimal set of flags to produce
> the crash.  Then use cvise ( to reduce
> prims.ii into a test case and report via
> with the test case attached.
> If the segfault can't be reproduced with latest g++ trunk and the
> preprocessed file, you can try to rebase your changes onto the latest
> trunk.  If the crash still happens for the rebased code, it indicates
> you've done something wrong modifying GCC.  You can still use cvise to
> get a minimal test case to reproduce the crash for you, and then use a
> debugger (like gdb) to figure out what's going wrong.
> --
> Xi Ruoyao <>
> School of Aerospace Science and Technology, Xidian University

More information about the Gcc-help mailing list