The session below, with the file below, gives "internal compiler error: in int_mode_for_mode, at stor- layout.c:251". The error only occurs at -O1 or higher. This sounds like bug 17407, but that's supposedly fixed and didn't require optimization. The file is an odd-looking Delta reduction of a much larger file, which was originally supposed to be valid code; but I haven't gotten the include paths set up properly yet. File: { }; class NameOne; { { { { { } { } } } } } struct NameTwo::private_data { struct offsets { }; }; class NameThree : public NameFour { NameThree( NameOne frame, const char *name, NameFive *target, float min, float max, orientation direction); }; NameThree::NameThree(NameOne frame, const char *name, NameFive *target, float minv, float maxv, orientation direction) : NameFour(frame, name, target, minv, maxv, direction) Session: 9> /opt/gcc401chk/bin/g++ -v -O1 ../cpp/bugfiles/GCC_bugfiles/error/105107_OutlineView_min.ii Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../configure --enable-checking --prefix=/opt/gcc401chk --enable-languages=c,c+ + Thread model: posix gcc version 4.0.1 /opt/gcc401chk/libexec/gcc/i686-pc-linux-gnu/4.0.1/cc1plus -fpreprocessed ../cpp/bugfiles/ GCC_bugfiles/error/105107_OutlineView_min.ii -quiet -dumpbase 105107_OutlineView_min.ii - mtune=pentiumpro -auxbase 105107_OutlineView_min -O1 -version -o /tmp/cctwDCac.s GNU C++ version 4.0.1 (i686-pc-linux-gnu) compiled by GNU C version 3.3.4 (pre 3.3.5 20040809). GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 … ../cpp/bugfiles/GCC_bugfiles/error/105107_OutlineView_min.ii:28: internal compiler error: in int_mode_for_mode, at stor-layout.c:251 Please submit a full bug report, …
Created attachment 9370 [details] 105107_OutlineView_min.ii Delta-reduced file. PalmSource bug 105107.
Confirmed, a regression from 3.4.0.
A more reduced testcase: class NameOne; void f(NameOne){}
Here is the backtrace for 4.10: #2 0x08487dde in int_mode_for_mode (mode=248) at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/ stor-layout.c:248 #3 0x082e44e1 in emit_move_via_integer (mode=VOIDmode, x=0xb7cd6830, y=0xb7c3aeac) at / home/peshtigo/pinskia/src/gnu/gcc/src/gcc/expr.c:2818 #4 0x082f0959 in emit_move_insn_1 (x=0xb7cd6830, y=0xb7c3aeac) at /home/peshtigo/pinskia/ src/gnu/gcc/src/gcc/expr.c:3119 #5 0x082f0f8c in emit_move_insn (x=0xb7cd6830, y=Variable "y" is not available. ) at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/expr.c:3182 #6 0x08337cf5 in assign_parm_setup_reg (all=0xbfe41d14, parm=0xb7c3c730, data=0xbfe41d6c) at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/function.c:2685 #7 0x0833c185 in assign_parms (fndecl=0xb7cd7e80) at /home/peshtigo/pinskia/src/gnu/gcc/src/ gcc/function.c:2964 #8 0x0833cf15 in expand_function_start (subr=0xb7cd7e80) at /home/peshtigo/pinskia/src/gnu/ gcc/src/gcc/function.c:4168 For 4.0.0: #0 internal_error (msgid=0x8630797 "int_mode_for_mode") at /home/peshtigo/pinskia/src/gnu/gcc/ src/gcc/diagnostic.c:496 #1 0x082a35bf in fancy_abort (file=0x8630797 "int_mode_for_mode", line=251, function=0x8630797 "int_mode_for_mode") at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/diagnostic.c:556 #2 0x084795de in int_mode_for_mode (mode=140707735) at /home/peshtigo/pinskia/src/gnu/gcc/ src/gcc/stor-layout.c:251 #3 0x082e0cb1 in emit_move_via_integer (mode=VOIDmode, x=0xb7d68860, y=0xb7ce2edc) at / home/peshtigo/pinskia/src/gnu/gcc/src/gcc/expr.c:2761 #4 0x082efa0a in emit_move_insn_1 (x=0xb7d68860, y=0xb7ce2edc) at /home/peshtigo/pinskia/ src/gnu/gcc/src/gcc/expr.c:3056 #5 0x082f0085 in emit_move_insn (x=0xb7d68860, y=Variable "y" is not available. ) at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/expr.c:3119 #6 0x08335742 in assign_parm_setup_reg (all=0xbffc1d68, parm=0xb7d70000, data=0xbffc1dbc) at /home/peshtigo/pinskia/src/gnu/gcc/src/gcc/function.c:2838 #7 0x0833adbb in assign_parms (fndecl=0xb7d700d8) at /home/peshtigo/pinskia/src/gnu/gcc/src/ gcc/function.c:3126 #8 0x0833b1c7 in expand_function_start (subr=0xb7d700d8) at /home/peshtigo/pinskia/src/gnu/ gcc/src/gcc/function.c:4218
Testing a patch.
Subject: Bug 23089 CVSROOT: /cvs/gcc Module name: gcc Changes by: reichelt@gcc.gnu.org 2005-08-22 08:37:18 Modified files: gcc/cp : ChangeLog decl.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/other: incomplete1.C Log message: PR c++/23089 * decl.c (require_complete_types_for_parms): Mark incomplete types as invalid. * g++.dg/other/incomplete1.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4852&r2=1.4853 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1418&r2=1.1419 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5945&r2=1.5946 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/other/incomplete1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
Subject: Bug 23089 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: reichelt@gcc.gnu.org 2005-08-22 08:48:06 Modified files: gcc/cp : ChangeLog decl.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/other: incomplete1.C Log message: PR c++/23089 * decl.c (require_complete_types_for_parms): Mark incomplete types as invalid. * g++.dg/other/incomplete1.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.4648.2.77&r2=1.4648.2.78 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.1371.2.17&r2=1.1371.2.18 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.342&r2=1.5084.2.343 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/other/incomplete1.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
Fixed on mainline and the 4.0 branch.