Bug 10451 - [3.2 regression] ICE in grokdeclarator on spurious mutable declaration
Summary: [3.2 regression] ICE in grokdeclarator on spurious mutable declaration
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.2.2
: P3 normal
Target Milestone: ---
Assignee: Mark Mitchell
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2003-04-22 13:36 UTC by mark.merriman
Modified: 2003-07-25 17:33 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
errorfile.cpp.gz (280.11 KB, application/x-gzip )
2003-05-21 15:17 UTC, mark.merriman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mark.merriman 2003-04-22 13:36:00 UTC
Compile the attached file with gcc 3.2.2 (no arguments)

ConfigurationInputs.cpp: In member function `void
   ConfigurationInputs::removeInput(Basic::InputConfigStruct*)':
ConfigurationInputs.cpp:138: Internal compiler error in grokdeclarator, at
   cp/decl.c:11921

The error occurs at the 'mutable' definition.

Release:
3.2.2 Thread model: posix

Environment:
uname -a:

SunOS roscoe 5.8 Generic_108528-15 sun4u sparc SUNW,Sun-Blade-1000
Comment 1 mark.merriman 2003-04-22 13:36:00 UTC
Fix:
http://gcc.gnu.org/ml/gcc-patches/2003-04/msg01779.html
Comment 2 Giovanni Bajo 2003-04-22 16:34:53 UTC
From: "Giovanni Bajo" <giovannibajo@libero.it>
To: <gcc-gnats@gcc.gnu.org>,
	<gcc-bugs@gcc.gnu.org>,
	<mark.merriman@dc.alphatech.com>,
	<nobody@gcc.gnu.org>,
	<gcc-prs@gcc.gnu.org>
Cc: "Wolfgang Bangerth" <bangerth@ices.utexas.edu>
Subject: Re: middle-end/10451: (3.2.2) ICE on mutable definitions of iterators
Date: Tue, 22 Apr 2003 16:34:53 +0200

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
 r=10451
 
 Reduced snippet is:
 -----------------------------------------
 struct Bar
 {
     typedef int type;
 };
 
 struct Foo
 {
     void func(void)
     {
         mutable Bar::type x;
     }
 };
 -----------------------------------------
 pr10451.cpp: In member function `void Foo::func()':
 pr10451.cpp:10: Internal compiler error in grokdeclarator, at
 cp/decl.c:11906
 Please submit a full bug report,
 
 The code is illegal, but we should not ICE anyway. This is a 3.2/3.3/3.4
 regression wrt to 2.95 which was giving a normal error message.
 For the original poster: your code is illegal because mutable may not be
 used to define local variables.
 
 Giovanni Bajo
 
Comment 3 Wolfgang Bangerth 2003-04-22 23:05:04 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Just as Giovanni said
Comment 4 Mark Mitchell 2003-04-23 15:50:37 UTC
Responsible-Changed-From-To: unassigned->mmitchel
Responsible-Changed-Why: Working on a fix.
Comment 5 Mark Mitchell 2003-04-23 16:27:27 UTC
From: mmitchel@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/10451
Date: 23 Apr 2003 16:27:27 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	mmitchel@gcc.gnu.org	2003-04-23 16:27:27
 
 Modified files:
 	gcc/cp         : ChangeLog class.c cp-tree.h decl.c semantics.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/parse: crash4.C crash5.C 
 
 Log message:
 	PR c++/9847
 	* cp-tree.h (duplicate_tag_error): Remove.
 	* class.c (duplicate_tag_error): Remove.
 	* semantics.c (begin_class_definition): Return immediately for a
 	duplicate class definition.
 	
 	PR c++/10451
 	* decl.c (grokdeclarator): Correct logic for "mutable" errors.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3336&r2=1.3337
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/class.c.diff?cvsroot=gcc&r1=1.532&r2=1.533
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.838&r2=1.839
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1039&r2=1.1040
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&r1=1.300&r2=1.301
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2615&r2=1.2616
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/crash4.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/crash5.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
 
Comment 6 Mark Mitchell 2003-04-23 17:33:02 UTC
From: mmitchel@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/10451
Date: 23 Apr 2003 17:33:02 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	mmitchel@gcc.gnu.org	2003-04-23 17:33:02
 
 Modified files:
 	gcc/cp         : ChangeLog decl.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/parse: crash4.C 
 
 Log message:
 	PR c++/10451
 	* decl.c (grokdeclarator): Correct logic for "mutable" errors.
 	
 	PR c++/10451
 	* g++.dg/parse/crash4.C: New test.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.113&r2=1.3076.2.114
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.965.2.37&r2=1.965.2.38
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.150&r2=1.2261.2.151
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/crash4.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1
 

Comment 7 Mark Mitchell 2003-04-23 17:33:02 UTC
From: mmitchel@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/10451
Date: 23 Apr 2003 17:33:02 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	mmitchel@gcc.gnu.org	2003-04-23 17:33:02
 
 Modified files:
 	gcc/cp         : ChangeLog decl.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/parse: crash4.C 
 
 Log message:
 	PR c++/10451
 	* decl.c (grokdeclarator): Correct logic for "mutable" errors.
 	
 	PR c++/10451
 	* g++.dg/parse/crash4.C: New test.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.113&r2=1.3076.2.114
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.965.2.37&r2=1.965.2.38
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.150&r2=1.2261.2.151
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/crash4.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1
Comment 8 Mark Mitchell 2003-04-23 17:33:51 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed in GCC 3.3, GCC 3.4.