User account creation filtered due to spam.

Bug 50045 - [4.9/5/6 regression] ICE in gcc/java/lang.c:427 with -fdump-tree-all
Summary: [4.9/5/6 regression] ICE in gcc/java/lang.c:427 with -fdump-tree-all
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.7.0
: P4 normal
Target Milestone: 4.9.4
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2011-08-11 15:59 UTC by gee
Modified: 2016-01-27 18:22 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.6.0
Known to fail: 4.7.0
Last reconfirmed: 2012-02-02 00:00:00


Attachments
testcase: hello world! (350 bytes, application/octet-stream)
2011-08-11 15:59 UTC, gee
Details
testcase (20.41 KB, application/octet-stream)
2011-10-22 17:37 UTC, gee
Details
small testcase (p.class) (461 bytes, application/octet-stream)
2012-02-02 19:45 UTC, Andrew Pinski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gee 2011-08-11 15:59:05 UTC
Created attachment 24983 [details]
testcase: hello world!

It crashed while dumping to hello.class.019t.inline_param1

$ i686-pc-mingw32-gcj hello.class -g --main=hello -fdump-tree-all  -v -Wl,--verbose
Using built-in specs.
Reading specs from /usr/lib/gcc/i686-pc-mingw32/4.7.0/libgcj.spec
rename spec startfile to startfileorig
rename spec lib to liborig
COLLECT_GCC=i686-pc-mingw32-gcj
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-pc-mingw32/4.7.0/lto-wrapper.exe
Target: i686-pc-mingw32
Configured with: ./configure -C --prefix=/usr --enable-win32-registry --enable-java-awt=qt --enable-threads=win32 --enable-languages=c,c++,lto,java --with-win32-nlsapi=unicode --enable-tls --disable-bootstrap --target=i686-pc-mingw32 --enable-shared --enable-load-library --enable-interpreter --disable-sjlj-exceptions --enable-gomp --with-ecj-jar=/tmp/gcc/org.eclipse.jdt.core_3.7.0.v_B35.jar --with-antlr-jar=/tmp/gcc/antlr-3.3-complete.jar --with-libiconv-prefix=/usr/i686-pc-mingw32 --with-x=no : (reconfigured) ./configure -C --prefix=/usr --enable-win32-registry --enable-java-awt=qt --enable-threads=win32 --with-win32-nlsapi=unicode --enable-tls --disable-bootstrap --target=i686-pc-mingw32 --enable-shared --enable-load-library --enable-interpreter --disable-sjlj-exceptions --enable-gomp --with-ecj-jar=/tmp/gcc/org.eclipse.jdt.core_3.7.0.v_B35.jar --with-antlr-jar=/tmp/gcc/antlr-3.3-complete.jar --with-libiconv-prefix=/usr/i686-pc-mingw32 --with-x=no target_alias=i686-pc-mingw32 --enable-languages=c,c++,java,lto --no-create --no-recursion
Thread model: win32
gcc version 4.7.0 20110811 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-g' '-fdump-tree-all' '-v' '-fbootclasspath=.;C/:\Program Files\java\jdk1.7.0\jre\lib\ext\QTJava.zip;E/:\IBM\SQLLIB\java\db2java.zip;E/:\IBM\SQLLIB\java\db2jcc.jar;E/:\IBM\SQLLIB\java\sqlj.zip;E/:\IBM\SQLLIB\java\db2jcc_license_cu.jar;E/:\IBM\SQLLIB\bin;E/:\IBM\SQLLIB\java\common.jar:/usr/share/java/libgcj-4.7.0.jar' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
COLLECT_GCC_OPTIONS='-g' '-fdump-tree-all' '-v' '-fbootclasspath=.;C/:\Program Files\java\jdk1.7.0\jre\lib\ext\QTJava.zip;E/:\IBM\SQLLIB\java\db2java.zip;E/:\IBM\SQLLIB\java\db2jcc.jar;E/:\IBM\SQLLIB\java\sqlj.zip;E/:\IBM\SQLLIB\java\db2jcc_license_cu.jar;E/:\IBM\SQLLIB\bin;E/:\IBM\SQLLIB\java\common.jar:/usr/share/java/libgcj-4.7.0.jar' '-shared-libgcc' '-mtune=generic' '-march=pentiumpro'
 /usr/libexec/gcc/i686-pc-mingw32/4.7.0/jc1.exe hello.class -fhash-synchronization -fuse-divide-subroutine -fcheck-references -fuse-boehm-gc -fkeep-inline-functions -quiet -dumpbase hello.class -mtune=generic -march=pentiumpro -auxbase hello -g -version -fdump-tree-all -fbootclasspath=.;C/:\Program Files\java\jdk1.7.0\jre\lib\ext\QTJava.zip;E/:\IBM\SQLLIB\java\db2java.zip;E/:\IBM\SQLLIB\java\db2jcc.jar;E/:\IBM\SQLLIB\java\sqlj.zip;E/:\IBM\SQLLIB\java\db2jcc_license_cu.jar;E/:\IBM\SQLLIB\bin;E/:\IBM\SQLLIB\java\common.jar:/usr/share/java/libgcj-4.7.0.jar -faux-classpath /tmp/cczeZhvl.zip -o /tmp/ccBhJRyd.s
GNU Java (GCC) version 4.7.0 20110811 (experimental) (i686-pc-mingw32)
        compiled by GNU C version 4.7.0 20110801 (experimental), GMP version 5.0.0, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU Java (GCC) version 4.7.0 20110811 (experimental) (i686-pc-mingw32)
        compiled by GNU C version 4.7.0 20110801 (experimental), GMP version 5.0.0, MPFR version 2.4.2, MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Class path starts here:
    /tmp/cczeZhvl.zip/ (zip)
    .;C/ (system)
    \Program Files\java\jdk1.7.0\jre\lib\ext\QTJava.zip;E/ (system)
    \IBM\SQLLIB\java\db2java.zip;E/ (system)
    \IBM\SQLLIB\java\db2jcc.jar;E/ (system)
    \IBM\SQLLIB\java\sqlj.zip;E/ (system)
    \IBM\SQLLIB\java\db2jcc_license_cu.jar;E/ (system)
    \IBM\SQLLIB\bin;E/ (system)
    \IBM\SQLLIB\java\common.jar/ (system) (zip)
    /usr/share/java/libgcj-4.7.0.jar/ (system) (zip)
In class 'hello':
In method 'hello.main(java.lang.String[])':
jc1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ gdb --args /usr/libexec/gcc/i686-pc-mingw32/4.7.0/jc1.exe hello.class -fhash-synchronization -fuse-divide-subroutine -fcheck-references -fuse-boehm-gc -fkeep-inline-functions -quiet -dumpbase hello.class -mtune=generic -march=pentiumpro -auxbase hello -g -version -fdump-tree-all -fbootclasspath=.:/usr/share/java/libgcj-4.7.0.jar -faux-classpath hello.class -o /tmp/ccOXJ6ns.s
GNU gdb (GDB) 7.3.50.20110803-cvs
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-cygwin".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...

warning: the current range check setting does not match the language.


warning: the current type check setting does not match the language.

Whether backtraces should continue past the entry point of a program is off.
Reading symbols from /usr/libexec/gcc/i686-pc-mingw32/4.7.0/jc1.exe...done.
(gdb) r
Starting program: /usr/libexec/gcc/i686-pc-mingw32/4.7.0/jc1.exe hello.class -fhash-synchronization -fuse-divide-subroutine -fcheck-references -fuse-boehm-gc -fkeep-inline-functions -quiet -dumpbase hello.class -mtune=generic -march=pentiumpro -auxbase hello -g -version -fdump-tree-all -fbootclasspath=.:/usr/share/java/libgcj-4.7.0.jar -faux-classpath hello.class -o /tmp/ccOXJ6ns.s
[New Thread 14640.0xae8]
warning: section .gnu_debuglink not found in /cygdrive/d/cygwin/bin/cygwin1.dbg
[New Thread 14640.0x1af0]

Program received signal SIGSEGV, Segmentation fault.
0x00458abe in put_decl_node (node=0x7ff50780, verbosity=0x2)
    at ../.././gcc/java/lang.c:427
427                       put_decl_node (TREE_VALUE (args), verbosity);
(gdb) i local
__t = 0x0
i = 0x0
args = 0x0
was_pointer = 0x0
__FUNCTION__ = "put_decl_node"
(gdb) up
#1  0x00458fbd in lang_printable_name (decl=0x7ff50780, v=0x2)
    at ../.././gcc/java/lang.c:473
473       put_decl_node (decl, v);
(gdb) i local
No locals.
(gdb) up
#2  0x006d6d58 in cgraph_node_name (node=0x7ff415a8)
    at ../.././gcc/cgraph.c:1769
1769      return lang_hooks.decl_printable_name (node->decl, 2);
(gdb) i local
No locals.
(gdb) up
#3  0x00c4864c in dump_inline_edge_summary (f=0x2003b94c, indent=0x4,
    node=0x7ff40930, info=0x7ff82040) at ../.././gcc/ipa-inline-analysis.c:926
926           fprintf (f, "%*s%s/%i %s\n%*s  loop depth:%2i freq:%4i size:%2i time: %2i callee size:%2i stack:%2i",
(gdb) i local
es = 0x200e9e88
callee = 0x7ff415a8
edge = 0x7febe780
(gdb) up
#4  0x00c48b72 in dump_inline_summary (f=0x2003b94c, node=0x7ff40930)
    at ../.././gcc/ipa-inline-analysis.c:1011
1011          dump_inline_edge_summary (f, 4, node, s);
(gdb) i local
s = 0x7ff82040
e = 0x0
i = 0x2
__FUNCTION__ = "dump_inline_summary"
(gdb) up
#5  0x00c4d608 in estimate_function_body_sizes (node=0x7ff40930, early=0x1)
    at ../.././gcc/ipa-inline-analysis.c:1616
1616          dump_inline_summary (dump_file, node);
(gdb) i local
time = 0x48
size = 0x1c
bb = 0x0
bsi = {
  ptr = 0x0,
  seq = 0x7ff235e0,
  bb = 0x7fdd0c60
}
my_function = 0x7fe05400
__FUNCTION__ = "estimate_function_body_sizes"
freq = 0x3e8
info = 0x7ff82040
bb_predicate = {
  clause = {0x0, 0x111a576, 0x7ff11d70, 0x7ff52c80, 0x7ff52c80, 0x0, 0x0,
    0xc446f1, 0x7ff116b0}
}
parms_info = 0x0
nonconstant_names = 0x0
(gdb) up
#6  0x00c4d907 in compute_inline_parameters (node=0x7ff40930, early=0x1)
    at ../.././gcc/ipa-inline-analysis.c:1676
1676      estimate_function_body_sizes (node, early);
(gdb) i local
self_stack_size = 0x0
e = 0x0
info = 0x7ff82040
__FUNCTION__ = "compute_inline_parameters"
(gdb) up
#7  0x00c4d966 in compute_inline_parameters_for_current ()
    at ../.././gcc/ipa-inline-analysis.c:1692
1692      compute_inline_parameters (cgraph_get_node (current_function_decl), true);
(gdb) i local
No locals.
(gdb) up
#8  0x0066d34a in execute_one_pass (pass=0x102c240)
    at ../.././gcc/passes.c:2063
2063          todo_after = pass->execute ();
(gdb) i local
initializing_dump = 0x1
todo_after = 0x0
gate_status = 0x1
__FUNCTION__ = "execute_one_pass"
(gdb)
Comment 1 gee 2011-10-22 17:35:01 UTC
and newer one.

(gdb) r
Starting program: /tmp/gcc/host-i686-pc-cygwin/gcc/jc1.exe gnu.zip -fhash-synchronization -fuse-divide-subroutine -fcheck-references -fuse-boehm-gc -fkeep-inline-functions -quiet -dumpbase gnu.zip -mtune=generic -march=pentiumpro -auxbase-strip gnu/gcj/.libs/convert.o -g -O2 -Wno-deprecated -version -ffloat-store -fno-omit-frame-pointer -fencoding=UTF-8 -fbootstrap-classes -fsource-filename=/tmp/gcc/i686-pc-mingw32/libjava/classpath/lib/classes -fdump-tree-all -fbootclasspath=./:../.././libjava/classpath/lib/ -faux-classpath gnu.zip -MD_ -MT gnu/gcj/convert.lo -MF gnu/gcj/convert.deps -o /tmp/ccY2WWPD.s
[New Thread 5008.0xea0]
warning: section .gnu_debuglink not found in /cygdrive/d/cygwin/bin/cygwin1.dbg
[New Thread 5008.0x9d4]
GNU Java (GCC) version 4.7.0 20111021 (experimental) (i686-pc-mingw32)
        compiled by GNU C version 4.7.0 20111020 (experimental), GMP version 5.0.2, MPFR version 3.2.0-dev, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU Java (GCC) version 4.7.0 20111021 (experimental) (i686-pc-mingw32)
        compiled by GNU C version 4.7.0 20111020 (experimental), GMP version 5.0.2, MPFR version 3.2.0-dev, MPC version 0.9
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Class path starts here:
    gnu.zip/ (zip)
    ./ (system)
    ../.././libjava/classpath/lib/ (system)

Program received signal SIGSEGV, Segmentation fault.
put_decl_node (node=<optimized out>, verbosity=0x2)
    at ../.././gcc/java/lang.c:427
427                       put_decl_node (TREE_VALUE (args), verbosity);
(gdb) bt
#0  put_decl_node (node=<optimized out>, verbosity=0x2)
    at ../.././gcc/java/lang.c:427
#1  0x004376da in lang_printable_name (decl=0x7ff60780, v=0x2)
    at ../.././gcc/java/lang.c:473
#2  0x005b320a in cgraph_node_name (node=0x7ff57a10)
    at ../.././gcc/cgraph.c:1768
#3  0x009be355 in dump_inline_edge_summary (f=0x20137d0c, indent=0x4,
    info=0x7fbf6378, node=) at ../.././gcc/ipa-inline-analysis.c:1094
#4  0x009c323c in dump_inline_summary (node=0x7ff52a00, f=0x20137d0c)
    at ../.././gcc/ipa-inline-analysis.c:1194
#5  dump_inline_summary (f=0x20137d0c, node=0x7ff52a00)
    at ../.././gcc/ipa-inline-analysis.c:1161
#6  0x009c4b34 in estimate_function_body_sizes (early=0x1, node=0x7ff52a00)
    at ../.././gcc/ipa-inline-analysis.c:2053
#7  compute_inline_parameters (node=0x7ff52a00, early=0x1)
    at ../.././gcc/ipa-inline-analysis.c:2129
#8  0x009c5760 in compute_inline_parameters_for_current ()
    at ../.././gcc/ipa-inline-analysis.c:2147
#9  0x00514f0d in execute_one_pass (pass=0xd20c00) at ../.././gcc/passes.c:2064
#10 0x00515245 in execute_pass_list (pass=0xd20c00)
    at ../.././gcc/passes.c:2119
#11 0x005144bc in do_per_function_toporder (
    callback=0x515230 <execute_pass_list>, data=0xd20a80)
---Type <return> to continue, or q <return> to quit---
    at ../.././gcc/passes.c:1606
#12 0x005156a3 in execute_ipa_pass_list (pass=0xd20b40)
    at ../.././gcc/passes.c:2436
#13 0x005c0c22 in ipa_passes () at ../.././gcc/cgraphunit.c:2033
#14 cgraph_optimize () at ../.././gcc/cgraphunit.c:2145
#15 0x005c128f in cgraph_finalize_compilation_unit ()
    at ../.././gcc/cgraphunit.c:1327
#16 0x00588c3c in write_global_declarations () at ../.././gcc/langhooks.c:303
#17 0x004178ce in java_write_globals () at ../.././gcc/java/class.c:3241
#18 0x004fc3dc in compile_file () at ../.././gcc/toplev.c:581
#19 do_compile () at ../.././gcc/toplev.c:1930
#20 toplev_main (argc=0x22, argv=0x2003a368) at ../.././gcc/toplev.c:2006
#21 0x00cec270 in main (argc=0x22, argv=0x2003a368) at ../.././gcc/main.c:36
#22 0x610069a8 in _cygwin_exit_return ()
    at /tmp/winsup/winsup/cygwin/dcrt0.cc:897
#23 0x61004e56 in _cygtls::call2 (this=0x5ecce64,
    func=0x61005cd0 <dll_crt0_1(void*)>, arg=0x0, buf=0x5eccdc4)
    at /tmp/winsup/winsup/cygwin/cygtls.cc:69
Comment 2 gee 2011-10-22 17:37:37 UTC
Created attachment 25576 [details]
testcase
Comment 3 Andrew Pinski 2012-02-02 19:45:23 UTC
Confirmed.  I just ran into this myself.
Comment 4 Andrew Pinski 2012-02-02 19:45:56 UTC
Created attachment 26555 [details]
small testcase (p.class)
Comment 5 Kai Tietz 2012-02-22 16:45:28 UTC
Does the following patch fixes your problem?

ChangeLog

2012-02-20  Kai Tietz

        PR java/50045
        * lang.c (put_decl_node): Check also for args not
        nil.

Index: lang.c
===================================================================
--- lang.c      (revision 184426)
+++ lang.c      (working copy)
@@ -420,7 +420,8 @@
              if (TREE_CODE (TREE_TYPE (node)) == METHOD_TYPE)
                args = TREE_CHAIN (args);
              put_decl_string ("(", 1);
-             for ( ; args != end_params_node;  args = TREE_CHAIN (args), i++)
+             for ( ; args != NULL_TREE && args != end_params_node;
+                  args = TREE_CHAIN (args), i++)
                {
                  if (i > 0)
                    put_decl_string (",", 1);
Comment 6 Richard Biener 2012-03-22 08:27:25 UTC
GCC 4.7.0 is being released, adjusting target milestone.
Comment 7 Richard Biener 2012-06-14 08:43:25 UTC
GCC 4.7.1 is being released, adjusting target milestone.
Comment 8 Jakub Jelinek 2012-09-20 10:20:49 UTC
GCC 4.7.2 has been released.
Comment 9 Richard Biener 2013-04-11 07:59:34 UTC
GCC 4.7.3 is being released, adjusting target milestone.
Comment 10 Richard Biener 2014-06-12 13:44:03 UTC
The 4.7 branch is being closed, moving target milestone to 4.8.4.
Comment 11 Jakub Jelinek 2014-12-19 13:34:11 UTC
GCC 4.8.4 has been released.
Comment 12 Richard Biener 2015-06-23 08:16:40 UTC
The gcc-4_8-branch is being closed, re-targeting regressions to 4.9.3.
Comment 13 Jakub Jelinek 2015-06-26 19:58:05 UTC
GCC 4.9.3 has been released.
Comment 14 Jeffrey A. Law 2016-01-27 18:22:46 UTC
Kai fixed this back in early 2013, so it should be working in 4.9, 5 & on the trunk (I verified the latter, of course).