Bug 23089 - [4.0/4.1 Regression] internal compiler error: in int_mode_for_mode, at stor-layout.c:251 at -O1
Summary: [4.0/4.1 Regression] internal compiler error: in int_mode_for_mode, at stor-l...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.0.1
: P2 minor
Target Milestone: 4.0.2
Assignee: Volker Reichelt
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: error-recovery, ice-on-invalid-code, monitored, patch
Depends on:
Blocks:
 
Reported: 2005-07-27 02:29 UTC by Flash Sheridan
Modified: 2005-08-22 08:49 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.0 3.3.3
Known to fail: 4.0.0 4.1.0
Last reconfirmed: 2005-07-27 02:33:52


Attachments
105107_OutlineView_min.ii (212 bytes, text/plain)
2005-07-27 02:30 UTC, Flash Sheridan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Flash Sheridan 2005-07-27 02:29:28 UTC
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,
…
Comment 1 Flash Sheridan 2005-07-27 02:30:56 UTC
Created attachment 9370 [details]
105107_OutlineView_min.ii

Delta-reduced file.  
PalmSource bug 105107.
Comment 2 Andrew Pinski 2005-07-27 02:33:52 UTC
Confirmed, a regression from 3.4.0.
Comment 3 Andrew Pinski 2005-07-27 02:42:37 UTC
A more reduced testcase:
class NameOne;
void f(NameOne){}
Comment 4 Andrew Pinski 2005-07-27 02:44:30 UTC
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
Comment 5 Volker Reichelt 2005-08-18 15:25:55 UTC
Testing a patch.
Comment 6 GCC Commits 2005-08-22 08:37:30 UTC
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

Comment 7 GCC Commits 2005-08-22 08:48:24 UTC
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

Comment 8 Volker Reichelt 2005-08-22 08:49:47 UTC
Fixed on mainline and the 4.0 branch.