Bug 15640 - [3.4/4.0 regression] ICE in arg_assoc, at cp/name-lookup.c:4440
Summary: [3.4/4.0 regression] ICE in arg_assoc, at cp/name-lookup.c:4440
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 3.4.1
Assignee: Mark Mitchell
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2004-05-25 00:02 UTC by Aaron W. LaFramboise
Modified: 2004-10-30 21:11 UTC (History)
1 user (show)

See Also:
Host: i686-pc-mingw32
Target: i686-pc-mingw32
Build: i686-pc-mingw32
Known to work: 3.3.3
Known to fail: 3.4.0 4.0.0
Last reconfirmed: 2004-05-25 00:09:25


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron W. LaFramboise 2004-05-25 00:02:58 UTC
$ g++ -o mytest mytest.cpp
mytest.cpp: In function `void myfunction()':
mytest.cpp:9: internal compiler error: in arg_assoc, at cp/name-lookup.c:4440
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

--- mytest.cpp
#include <typeinfo>

class myclass {
};

template<typename type>
void myfunction() {
  myclass m;
  m + typeid(type).name;
}
---

$ gcc -v
Reading specs from 
c:/aaronwl/cs/compilers/mingw/gcc/vanilla/bin/../lib/gcc/mingw32/3.4.0/specs
Configured with: ../gcc-3.4.0/configure --with-gcc --with-gnu-ld --with-gnu-
as --host=mingw32 --target=mingw32 --
prefix=/aaronwl/cs/compilers/mingw/gcc/vanilla --enable-threads --disable-nls -
-enable-languages=c,c++ --disable-win32-registry --disable-shared --enable-
sjlj-exceptions
Thread model: win32
gcc version 3.4.0
Comment 1 Andrew Pinski 2004-05-25 00:09:05 UTC
Confirmed, a regression.
Comment 2 Giovanni Bajo 2004-05-25 01:49:43 UTC
BTW, this is not related to typeid, the following ICEs as well:

------------------------------
struct A {
  void foo(void);
};

template <int> void bar() {
  A a;
  a + a.foo;
}
------------------------------
Comment 3 Andrew Pinski 2004-05-25 01:52:38 UTC
This is invalid code as the non-template version errors out.
Comment 4 Mark Mitchell 2004-05-28 19:58:42 UTC
Working on a fix.
Comment 5 CVS Commits 2004-05-28 22:29:51 UTC
Subject: Bug 15640

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	mmitchel@gcc.gnu.org	2004-05-28 22:29:44

Modified files:
	gcc/cp         : ChangeLog decl2.c init.c name-lookup.c typeck.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/expr: ptrmem4.C 
	gcc/testsuite/g++.dg/template: operator3.C 
	gcc/testsuite/g++.dg/warn: noeffect5.C 

Log message:
	PR c++/15083
	* decl2.c (delete_sanity): Set TREE_SIDE_EFFECTS on a DELETE_EXPR,
	even in a templat.e
	* init.c (build_new): Likewise.
	
	PR c++/15640
	* name-lookup.c (arg_assoc): Robustify.
	
	PR c++/15471
	* typeck.c (unary_complex_lvalue): Use context_for_name_lookup
	when determining the scope to use for a pointer to member.
	
	PR c++/15083
	* g++.dg/warn/noeffect5.C: New test.
	
	PR c++/15471
	* g++.dg/expr/ptrmem4.C: New test.
	
	PR c++/15640
	* g++.dg/template/operator3.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.107&r2=1.3892.2.108
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.695.4.7&r2=1.695.4.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/init.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.356.2.9&r2=1.356.2.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/name-lookup.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.34.2.12&r2=1.34.2.13
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.519.2.16&r2=1.519.2.17
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.185&r2=1.3389.2.186
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/expr/ptrmem4.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/operator3.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/warn/noeffect5.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.2.4.1

Comment 6 CVS Commits 2004-05-28 22:36:00 UTC
Subject: Bug 15640

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-05-28 22:35:50

Modified files:
	gcc/cp         : ChangeLog decl2.c init.c name-lookup.c typeck.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/expr: ptrmem4.C 
	gcc/testsuite/g++.dg/template: operator3.C 
	gcc/testsuite/g++.dg/warn: noeffect6.C 

Log message:
	PR c++/15083
	* decl2.c (delete_sanity): Set TREE_SIDE_EFFECTS on a DELETE_EXPR,
	even in a templat.e
	* init.c (build_new): Likewise.
	
	PR c++/15640
	* name-lookup.c (arg_assoc): Robustify.
	
	PR c++/15471
	* typeck.c (unary_complex_lvalue): Use context_for_name_lookup
	when determining the scope to use for a pointer to member.
	
	PR c++/15083
	* g++.dg/warn/noeffect5.C: New test.
	
	PR c++/15471
	* g++.dg/expr/ptrmem4.C: New test.
	
	PR c++/15640
	* g++.dg/template/operator3.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4064&r2=1.4065
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&r1=1.709&r2=1.710
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/init.c.diff?cvsroot=gcc&r1=1.370&r2=1.371
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/name-lookup.c.diff?cvsroot=gcc&r1=1.54&r2=1.55
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.544&r2=1.545
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3789&r2=1.3790
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/expr/ptrmem4.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/operator3.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/warn/noeffect6.C.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 7 Mark Mitchell 2004-05-28 23:35:30 UTC
Fixed in GCC 3.4.1.