Bug 36766 - [4.4 Regression] natGC.cc:229: internal compiler error: Segmentation fault
Summary: [4.4 Regression] natGC.cc:229: internal compiler error: Segmentation fault
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.4.0
: P1 critical
Target Milestone: 4.4.0
Assignee: Jakub Jelinek
URL:
Keywords: build, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2008-07-09 00:58 UTC by John David Anglin
Modified: 2008-09-02 19:33 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-08-08 20:46:30


Attachments
natGC.ii (42.92 KB, application/octet-stream)
2008-07-11 18:29 UTC, Andreas Tobler
Details
natGC.ii.gz (43.93 KB, application/x-gunzip)
2008-07-20 17:06 UTC, dave
Details
preprocessed source from i686-linux (44.01 KB, application/octet-stream)
2008-07-20 17:46 UTC, Andreas Tobler
Details
gcc44-pr36766.patch (613 bytes, patch)
2008-09-02 14:23 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John David Anglin 2008-07-09 00:58:07 UTC
libtool: compile:  /home/dave/gnu/gcc/objdir/./gcc/xgcc -shared-libgcc -B/home/dave/gnu/gcc/objdir/
./gcc -nostdinc++ -L/home/dave/gnu/gcc/objdir/x86_64-suse-linux/32/libstdc++-v3/src -L/home/dave/gn
u/gcc/objdir/x86_64-suse-linux/32/libstdc++-v3/src/.libs -B/home/dave/opt/gnu/gcc/gcc-4.4.0/x86_64-
suse-linux/bin/ -B/home/dave/opt/gnu/gcc/gcc-4.4.0/x86_64-suse-linux/lib/ -isystem /home/dave/opt/g
nu/gcc/gcc-4.4.0/x86_64-suse-linux/include -isystem /home/dave/opt/gnu/gcc/gcc-4.4.0/x86_64-suse-li
nux/sys-include -m32 -DHAVE_CONFIG_H -I. -I../../../../gcc/libjava -I./include -I./gcj -I../../../../gcc/libjava -Iinclude -I../../../../gcc/libjava/include -I../../../../gcc/libjava/classpath/include -Iclasspath/include -I../../../../gcc/libjava/classpath/native/fdlibm -I../../../../gcc/libjava/../boehm-gc/include -I../boehm-gc/include -I../../../../gcc/libjava/libltdl -I../../../../gcc/libjava/libltdl -I../../../../gcc/libjava/.././libjava/../gcc -I../../../../gcc/libjava/../zlib -I../../../../gcc/libjava/../libffi/include -I../libffi/include -I../libstdc++-v3/include -I../libstdc++-v3/include/x86_64-suse-linux -I../../../../gcc/libjava/../libstdc++-v3/libsupc++ -fno-rtti -fnon-call-exceptions -fdollars-in-identifiers -Wswitch-enum -D_FILE_OFFSET_BITS=64 -ffloat-store -fomit-frame-pointer -Wextra -Wall -D_GNU_SOURCE -DPREFIX=\"/home/dave/opt/gnu/gcc/gcc-4.4.0\" -DTOOLEXECLIBDIR=\"/home/dave/opt/gnu/gcc/gcc-4.4.0/lib/gcc/x86_64-suse-linux/4.4.0/32\" -DJAVA_HOME=\"/home/dave/opt/gnu/gcc/gcc-4.4.0\" -DBOOT_CLASS_PATH=\"/home/dave/opt/gnu/gcc/gcc-4.4.0/share/java/libgcj-4.4.0.jar\" -DJAVA_EXT_DIRS=\"/home/dave/opt/gnu/gcc/gcc-4.4.0/share/java/ext\" -DGCJ_ENDORSED_DIRS=\"/home/dave/opt/gnu/gcc/gcc-4.4.0/share/java/gcj-endorsed\" -DGCJ_VERSIONED_LIBDIR=\"/home/dave/opt/gnu/gcc/gcc-4.4.0/lib/../lib/gcj-4.4.0-10\" -DPATH_SEPARATOR=\":\" -DECJ_JAR_FILE=\"\" -DLIBGCJ_DEFAULT_DATABASE=\"/home/dave/opt/gnu/gcc/gcc-4.4.0/lib/../lib/gcj-4.4.0-10/classmap.db\" -DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL=\"gcj-4.4.0-10/classmap.db\" -g -O2 -D_GNU_SOURCE -m32 -MT gnu/gcj/xlib/lib_gnu_awt_xlib_la-natGC.lo -MD -MP -MF gnu/gcj/xlib/.deps/lib_gnu_awt_xlib_la-natGC.Tpo -c ../../../../gcc/libjava/gnu/gcj/xlib/natGC.cc  -fPIC -DPIC -o gnu/gcj/xlib/.libs/lib_gnu_awt_xlib_la-natGC.o
../../../../gcc/libjava/gnu/gcj/xlib/natGC.cc: In member function 'void gnu::gcj::xlib::GC::updateClip(AWTRectArray*)':
../../../../gcc/libjava/gnu/gcj/xlib/natGC.cc:229: internal compiler error: Segmentation fault

dave@linux-qx3f:~/gnu/gcc/objdir/gcc> ./xgcc -B./ -v
Reading specs from ./specs
Target: x86_64-suse-linux
Configured with: ../gcc/configure --with-gnu-as --with-gnu-ld --enable-shared --prefix=/home/dave/opt/gnu/gcc/gcc-4.4.0 --with-local-prefix=/home/dave/opt/gnu --enable-threads=posix --enable-__cxa_atexit --build=x86_64-suse-linux --enable-clocale=gnu --enable-java-gc=boehm --enable-java-awt=xlib--enable-version-specific-runtime-libs --enable-linux-futex --without-system-libunwind --with-cpu=generic --enable-languages=c,c++,objc,fortran,obj-c++,java,ada
Thread model: posix
gcc version 4.4.0 20080708 (experimental) [trunk revision 137646] (GCC)

Running under gdb:
...
*, jint, jint, jint) void gnu::gcj::xlib::GC::updateClip(AWTRectArray*)
Program received signal SIGSEGV, Segmentation fault.
last_stmt (bb=0x0) at ../../gcc/gcc/tree-flow-inline.h:789
789       if (bb->index < NUM_FIXED_BLOCKS)
(gdb) bt
#0  last_stmt (bb=0x0) at ../../gcc/gcc/tree-flow-inline.h:789
#1  0x000000000082d45e in tree_purge_dead_eh_edges (bb=0x0) at ../../gcc/gcc/tree-cfg.c:6888
#2  0x000000000082d606 in tree_purge_all_dead_eh_edges (blocks=<value optimized out>)
    at ../../gcc/gcc/tree-cfg.c:6916
#3  0x00000000009421ce in fini_pre () at ../../gcc/gcc/tree-ssa-pre.c:4144
#4  0x000000000094a765 in execute_pre (do_fre=1 '\001') at ../../gcc/gcc/tree-ssa-pre.c:4227
#5  0x00000000007a0453 in execute_one_pass (pass=0x11257a0) at ../../gcc/gcc/passes.c:1293
#6  0x00000000007a0685 in execute_pass_list (pass=0x11257a0) at ../../gcc/gcc/passes.c:1343
#7  0x00000000007a069d in execute_pass_list (pass=0x1123e40) at ../../gcc/gcc/passes.c:1344
#8  0x000000000088f636 in tree_rest_of_compilation (fndecl=0x7fc7f1cd18f0)
    at ../../gcc/gcc/tree-optimize.c:425
#9  0x0000000000a40372 in cgraph_expand_function (node=0x7fc7f1cedc00)
    at ../../gcc/gcc/cgraphunit.c:1158
#10 0x0000000000a42de4 in cgraph_optimize () at ../../gcc/gcc/cgraphunit.c:1221
#11 0x00000000004b6125 in cp_write_global_declarations () at ../../gcc/gcc/cp/decl2.c:3538
#12 0x00000000008255cf in toplev_main (argc=<value optimized out>, argv=<value optimized out>)
    at ../../gcc/gcc/toplev.c:976
#13 0x00007fc7f292d436 in __libc_start_main () from /lib64/libc.so.6
#14 0x0000000000404529 in _start ()
Comment 1 Daniel Berlin 2008-07-09 01:56:20 UTC
Subject: Re:  [4.4 Regression] natGC.cc:229: internal compiler error: Segmentation fault

need .ii file at least.


On Tue, Jul 8, 2008 at 9:15 PM, pinskia at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> --
>
> pinskia at gcc dot gnu dot org changed:
>
>           What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                 CC|                            |dberlin at gcc dot gnu dot
>                   |                            |org
>           Keywords|                            |build, ice-on-valid-code
>            Summary|natGC.cc:229: internal      |[4.4 Regression]
>                   |compiler error: Segmentation|natGC.cc:229: internal
>                   |fault                       |compiler error: Segmentation
>                   |                            |fault
>   Target Milestone|---                         |4.4.0
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36766
>
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
>
Comment 2 John David Anglin 2008-07-10 23:02:36 UTC
Also occurs on hppa-unknown-linux-gnu.
Comment 3 Andreas Tobler 2008-07-11 18:29:54 UTC
Created attachment 15900 [details]
natGC.ii
Comment 4 Andreas Tobler 2008-07-11 18:31:55 UTC
The previously attached natGC.ii is from powerpc-apple-darwin9.3.0.
Comment 5 Richard Biener 2008-07-18 17:00:19 UTC
Is this fixed now?
Comment 6 dave 2008-07-20 02:42:03 UTC
Subject: Re:  [4.4 Regression] natGC.cc:229:
	internal compiler error: Segmentation fault

> Is this fixed now?

No.  Still broken with revision 137996.

Dave
Comment 7 Richard Biener 2008-07-20 11:16:37 UTC
x86_64-linux-gnu (obviously) works for me.
Comment 8 Daniel Berlin 2008-07-20 14:03:34 UTC
Subject: Re:  [4.4 Regression] natGC.cc:229: internal compiler error: Segmentation fault

I tried i686-darwin and it work for me too.
I'll try cross to ppc-darwin.


On Sun, Jul 20, 2008 at 7:16 AM, rguenth at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> ------- Comment #7 from rguenth at gcc dot gnu dot org  2008-07-20 11:16 -------
> x86_64-linux-gnu (obviously) works for me.
>
>
> --
>
> rguenth at gcc dot gnu dot org changed:
>
>           What    |Removed                     |Added
> ----------------------------------------------------------------------------
>  GCC build triplet|x86_64-suse-linux           |
>   GCC host triplet|x86_64-suse-linux           |
>  GCC target triplet|x86_64-suse-linux           |ppc-apple-darwin, hppa-
>                   |                            |linux-gnu
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36766
>
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
>
Comment 9 Andreas Tobler 2008-07-20 14:56:45 UTC
aehm, triggers on ppc-linux as well. Important key: --enable-java-awt=xlib

Otherwise it does not trigger on a default config for libjava.
Comment 10 dave 2008-07-20 15:36:23 UTC
Subject: Re:  [4.4 Regression] natGC.cc:229: internal compiler error: Segmentation fault

> ------- Comment #7 from rguenth at gcc dot gnu dot org  2008-07-20 11:16 -------
> x86_64-linux-gnu (obviously) works for me.

Have you tried configuring with --enable-java-awt="xlib"?  Otherwise,
it works for me with suse 11.0.

Dave
Comment 11 Andreas Tobler 2008-07-20 16:10:21 UTC
--enable-java-awt=xlib makes it break under i686-darwin and i686-linux as well. 
Comment 12 Richard Biener 2008-07-20 16:38:55 UTC
Can you then provide preprocessed source that breaks? ;)
Comment 13 dave 2008-07-20 17:06:46 UTC
Subject: Re:  [4.4 Regression] natGC.cc:229:
	internal compiler error: Segmentation fault

Attached x86_64 version.  This is the third time of tried to send this.

Dave
Comment 14 dave 2008-07-20 17:06:46 UTC
Created attachment 15932 [details]
natGC.ii.gz
Comment 15 Andreas Tobler 2008-07-20 17:46:29 UTC
Created attachment 15933 [details]
preprocessed source from i686-linux

The preprocessed source from i686-linux....
Comment 16 Andrew Pinski 2008-07-20 17:46:56 UTC
With the first preprocessed source I can reproduce this with -O2 -fnon-call-exceptions on powerpc-linux-gnu, reducing.
Comment 17 Andrew Pinski 2008-07-20 19:15:09 UTC
Reduced testcase compile with -O1 -fnon-call-exceptions:
struct _Vector_base     {
  ~_Vector_base()       {
   int* _M_start1 = this->_M_start;
  }
  int* _M_start;
};
struct vector  : _Vector_base
{
  vector(){
    int* _M_start1 = this->_M_start;
  }
  ~vector(){
    int* _M_start1 = this->_M_start;
  }
};
void  updateClip() {
  vector* xrectvector = new vector;
  delete xrectvector;
}
--- CUT ---
Comment 18 Daniel Berlin 2008-07-20 21:13:37 UTC
Subject: Re:  [4.4 Regression] natGC.cc:229: internal compiler error: Segmentation fault

All the blocks we have marked in the bitmap to eh cleanup exist when
we pass them to tree_purge_dead_eh_edges.
tree_purge_dead_eh_edges seems to decide to delete some of them
earlier than it expects, and then crashes when they don't later exist.

On Sun, Jul 20, 2008 at 4:39 PM, rguenth at gcc dot gnu dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> --
>
> rguenth at gcc dot gnu dot org changed:
>
>           What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                 CC|                            |rguenth at gcc dot gnu dot
>                   |                            |org
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36766
>
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
>
Comment 19 Andreas Tobler 2008-07-25 18:30:07 UTC
Fyi, this seems resloved on the tuples branch. Tested on various darwin combinations and on i686-linux.
Comment 20 Richard Biener 2008-07-28 16:15:43 UTC
I can reproduce this on the trunk after the tuples merge (i686).
Comment 21 Andreas Tobler 2008-08-08 20:50:29 UTC
Ok, to clarify, the bootstrap issue 'has gone', but the reduced test case from #17 still fails. Failure confirmed on i686-apple-darwin r138861.
Comment 22 Jakub Jelinek 2008-09-02 14:23:49 UTC
Created attachment 16191 [details]
gcc44-pr36766.patch

I don't see tree-ssa-dom.c or tree-ssa-pre.c are at fault here (not guessing that some basic block will be purged as unneeded), so it should be gimple_purge_all_eh_edges that needs to be changed to handle this.
Comment 23 Jakub Jelinek 2008-09-02 19:15:07 UTC
Subject: Bug 36766

Author: jakub
Date: Tue Sep  2 19:13:47 2008
New Revision: 139908

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=139908
Log:
	PR tree-optimization/36766
	* tree-cfg.c (gimple_purge_all_dead_eh_edges): Do nothing
	for already removed basic blocks.

	* g++.dg/tree-ssa/pr36766.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/tree-ssa/pr36766.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-cfg.c

Comment 24 Jakub Jelinek 2008-09-02 19:33:14 UTC
Fixed.
Comment 25 dave 2008-09-02 19:53:35 UTC
Subject: Re:  [4.4 Regression] natGC.cc:229: internal compiler error: Segmentation fault

> Fixed.

Thanks,
Dave