Bug 17329 - [4.0 Regression] ICE: SEGV in java_gimplify_expr
Summary: [4.0 Regression] ICE: SEGV in java_gimplify_expr
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.0.0
: P2 critical
Target Milestone: 4.0.0
Assignee: Tom Tromey
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks: 17574
  Show dependency treegraph
 
Reported: 2004-09-05 14:06 UTC by Anthony Green
Modified: 2004-09-23 16:27 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work: 3.4.2
Known to fail: 4.0.0
Last reconfirmed: 2004-09-05 18:50:29


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Green 2004-09-05 14:06:33 UTC
I get a SEGV in jc1 while building jython from rhug.  No small test case yet.
This happens at any optimization level.


$ ./jc1
/home/green/sources/jhbuild-src/rhug/jython/upstream/src/org/python/util/jython.java
-fhash-synchronization -fno-use-divide-subroutine -fuse-boehm-gc
-fnon-call-exceptions -fno-omit-frame-pointer -fkeep-inline-functions -quiet
-dumpbase jython.java -mtune=pentiumpro -auxbase-strip
upstream/src/org/python/util/.libs/jython.o -g -O0 -Wno-deprecated -version
-fencoding=ISO-8859-1 -fno-assert
-fclasspath=upstream/src:/home/green/sources/jhbuild-src/rhug/jython/upstream/src:/home/green/sources/jhbuild-src/rhug/jython/../gnu.readline/upstream/src:/home/green/sources/jhbuild-src/rhug/jython/../jakarta-oro/upstream/src/java:/home/green/sources/jhbuild-src/rhug/jython/../jakarta-servletapi-4/upstream/src/share
-fassume-compiled -fPIC
[lots of output deleted]
/home/green/sources/jhbuild-src/rhug/jython/upstream/src/org/python/util/jython.java:261:
internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

and from gdb....

Program received signal SIGSEGV, Segmentation fault.
0x080bd4eb in java_gimplify_expr (expr_p=0xf6eca334, pre_p=0xfeeae174,
    post_p=0xfeeae170)
    at /home/green/sources/jhbuild-src/gcc/gcc/java/java-gimplify.c:111
111           if (TREE_CODE (TREE_OPERAND (*expr_p, 0)) == VAR_DECL)
(gdb) where
#0  0x080bd4eb in java_gimplify_expr (expr_p=0xf6eca334, pre_p=0xfeeae174,
    post_p=0xfeeae170)
    at /home/green/sources/jhbuild-src/gcc/gcc/java/java-gimplify.c:111
During symbol reading, Incomplete CFI data; unspecified registers at
0x080bd542.During symbol reading, Incomplete CFI data; unspecified registers at
0x080bd542.During symbol reading, Incomplete CFI data; unspecified registers at
0x080bd542.During symbol reading, Incomplete CFI data; unspecified registers at
0x080bd542.#1  0x080e17cd in gimplify_expr (expr_p=0xf6eca334, pre_p=0xfeeae174,
    post_p=0xfeeae170, gimple_test_f=0x80d87a4 <is_gimple_stmt>,
    fallback=fb_none)
    at /home/green/sources/jhbuild-src/gcc/gcc/gimplify.c:3539
During symbol reading, Incomplete CFI data; unspecified registers at
0x080e1a10.During symbol reading, Incomplete CFI data; unspecified registers at
0x080e1a10.During symbol reading, Incomplete CFI data; unspecified registers at
0x080e1a10.During symbol reading, Incomplete CFI data; unspecified registers at
0x080e1a10.#2  0x080e168d in gimplify_stmt (stmt_p=0xf6eca334)
    at /home/green/sources/jhbuild-src/gcc/gcc/gimplify.c:3437
During symbol reading, Incomplete CFI data; unspecified registers at
0x080e1688.During symbol reading, Incomplete CFI data; unspecified registers at
0x080e1688.During symbol reading, Incomplete CFI data; unspecified registers at
0x080e1688.During symbol reading, Incomplete CFI data; unspecified registers at
0x080e1688.During symbol reading, Incomplete CFI data; unspecified registers at
0x080e1688.During symbol reading, Incomplete CFI data; unspecified registers at
0x080e1688.During symbol reading, Incomplete CFI data; unspecified registers at
0x080e1688.#3  0x080e019d in gimplify_compound_expr (expr_p=0xfeeae290,
pre_p=0xfeeae474,
    want_value=1 '\001')
    at /home/green/sources/jhbuild-src/gcc/gcc/gimplify.c:2965
During symbol reading, Incomplete CFI data; unspecified registers at
0x080e0219.During symbol reading, Incomplete CFI data; unspecified registers at
0x080e0219.During symbol reading, Incomplete CFI data; unspecified registers at
0x080e0219.During symbol reading, Incomplete CFI data; unspecified registers at
0x080e0219.#4  0x080e230a in gimplify_expr (expr_p=0xfeeae290, pre_p=0xfeeae474,
    post_p=0xfeeae470, gimple_test_f=0x80d84f4 <is_gimple_formal_tmp_rhs>,
    fallback=fb_rvalue)
    at /home/green/sources/jhbuild-src/gcc/gcc/gimplify.c:3585
During symbol reading, Incomplete CFI data; unspecified registers at
0x080e23e1.#5  0x080d96e6 in internal_get_tmp_var (val=0xf6eca318, pre_p=0xfeeae474,
    post_p=0xfeeae470, is_formal=0 '\0')
    at /home/green/sources/jhbuild-src/gcc/gcc/gimplify.c:468
#6  0x080d97ce in get_initialized_tmp_var (val=0xf6eca318, pre_p=0xfeeae474,
    post_p=0xfeeae470)
    at /home/green/sources/jhbuild-src/gcc/gcc/gimplify.c:497
#7  0x080e037c in gimplify_save_expr (expr_p=0xf6de29ac, pre_p=0xfeeae474,
    post_p=0xfeeae470)
    at /home/green/sources/jhbuild-src/gcc/gcc/gimplify.c:3045
#8  0x080e268f in gimplify_expr (expr_p=0xf6de29ac, pre_p=0xfeeae474,
    post_p=0xfeeae470, gimple_test_f=0x80d896c <is_gimple_formal_tmp_var>,
    fallback=fb_rvalue)
    at /home/green/sources/jhbuild-src/gcc/gcc/gimplify.c:3756
#9  0x080bd64c in java_gimplify_expr (expr_p=0x3c, pre_p=0xfeeae474,
    post_p=0xfeeae470)
    at /home/green/sources/jhbuild-src/gcc/gcc/java/java-gimplify.c:147
#10 0x080e17cd in gimplify_expr (expr_p=0xf6de29d4, pre_p=0xfeeae474,
    post_p=0xfeeae470, gimple_test_f=0x80d85f8 <is_gimple_mem_rhs>,
    fallback=fb_rvalue)
    at /home/green/sources/jhbuild-src/gcc/gcc/gimplify.c:3539
#11 0x080dfdce in gimplify_modify_expr (expr_p=0xf6ddb5c0, pre_p=0xfeeae474,
    post_p=0xfeeae470, want_value=0 '\0')
    at /home/green/sources/jhbuild-src/gcc/gcc/gimplify.c:2852
#12 0x080e2327 in gimplify_expr (expr_p=0xf6ddb5c0, pre_p=0xfeeae474,
    post_p=0xfeeae470, gimple_test_f=0x80d87a4 <is_gimple_stmt>,
    fallback=fb_none)
    at /home/green/sources/jhbuild-src/gcc/gcc/gimplify.c:3590
#13 0x080e168d in gimplify_stmt (stmt_p=0xf6ddb5c0)
    at /home/green/sources/jhbuild-src/gcc/gcc/gimplify.c:3437
#14 0x080e16a1 in gimplify_to_stmt_list (stmt_p=0xf6ddb5c0)
---Type <return> to continue, or q <return> to quit---
[etc]
(gdb) p expr_p
$1 = (tree *) 0xf6eca334
(gdb) pt
 <this 0xf6eca334
    type <var_decl 0xf5fd189c verbose
        type <integer_type 0xf6ecb3a0 int public SI
            size <integer_cst 0xf6ec82a0 constant invariant 32>
            unit size <integer_cst 0xf6ec80c0 constant invariant 4>
            align 32 symtab 0 alias set 16 precision 32 min <integer_cst
0xf6ec8270 -2147483648> max <integer_cst 0xf6ec8288 2147483647>
            pointer_to_this <pointer_type 0xf6eba414> chain <type_decl
0xf6ecb414 int>>
        public static external decl_1 SI file
/home/green/sources/jhbuild-src/rhug/jython/upstream/src/org/python/core/Options.java
line 61 size <integer_cst 0xf6ec82a0 32> unit size <integer_cst 0xf6ec80c0 4>
        align 32 context <record_type 0xf5fd1414 org.python.core.Options>
initial <expr_with_file_location 0xf5fcfb18>
        (mem/i:SI (symbol_ref:SI ("_ZN3org6python4core7Options7verboseE") [flags
0x40] <var_decl 0xf5fd189c verbose>) [16 verbose+0 S4 A32])
        chain <var_decl 0xf5fd1910 deprecatedKeywordMangling type <boolean_type
0xf6ecbf68 boolean>
            public static unsigned external decl_1 QI file
/home/green/sources/jhbuild-src/rhug/jython/upstream/src/org/python/core/Options.java
line 67
            size <integer_cst 0xf6ec8138 constant invariant 8>
            unit size <integer_cst 0xf6ec8150 constant invariant 1>
            align 8 context <record_type 0xf5fd1414 org.python.core.Options>
initial <integer_cst 0xf6ec88a0 1> chain <var_decl 0xf5fd19f8 proxyDebugDirectory>>>
    side-effects readonly constant invariant public protected static deprecated
visited tree_1 tree_2 tree_4 tree_5 tree_6
    chain <save_expr 0xf5f89800
        type <void_type 0xf6ecbc3c void VOID
            align 1 symtab 0 alias set -1
            pointer_to_this <pointer_type 0xf6ecbd24> chain <type_decl
0xf6ecbcb0 void>>
        side-effects invariant public tree_5>>
Comment 1 Tom Tromey 2004-09-05 18:50:29 UTC
I see this while building jython as well.
Comment 2 Giovanni Bajo 2004-09-06 12:46:28 UTC
Is this a regression? which versions are affected?
Comment 3 Anthony Green 2004-09-06 16:33:51 UTC
Yes, this is a regression for HEAD.  It was working the last time I tried (a
small number of weeks ago I think).
Comment 4 Giovanni Bajo 2004-09-06 16:58:08 UTC
Marked as regression, then, so that it catches attention.
Comment 5 Tom Tromey 2004-09-22 00:01:17 UTC
I'm testing a patch for this.
Comment 6 GCC Commits 2004-09-23 16:24:47 UTC
Subject: Bug 17329

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tromey@gcc.gnu.org	2004-09-23 16:24:43

Modified files:
	libjava        : ChangeLog 
Added files:
	libjava/testsuite/libjava.compile: pr17329.java 

Log message:
	PR java/17329:
	* testsuite/libjava.compile/pr17329.java: New file.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&r1=1.3071&r2=1.3072
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/testsuite/libjava.compile/pr17329.java.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 7 GCC Commits 2004-09-23 16:25:52 UTC
Subject: Bug 17329

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	tromey@gcc.gnu.org	2004-09-23 16:25:37

Modified files:
	gcc/java       : ChangeLog java-gimplify.c 

Log message:
	PR java/17329:
	* java-gimplify.c (java_gimplify_expr) <SAVE_EXPR>: Ignore case
	where operand is null.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1459&r2=1.1460
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/java-gimplify.c.diff?cvsroot=gcc&r1=1.14&r2=1.15

Comment 8 Tom Tromey 2004-09-23 16:27:36 UTC
Fix checked in.