Bug 13968 - [3.4/4.0 Regression] Internal compiler error while compiling Boost library
Summary: [3.4/4.0 Regression] Internal compiler error while compiling Boost library
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.0
: P2 critical
Target Milestone: 3.4.0
Assignee: Mark Mitchell
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2004-02-01 23:47 UTC by Ralf W. Grosse-Kunstleve
Modified: 2004-09-13 14:15 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux
Target: i686-pc-linux
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-02-02 00:43:26


Attachments
Preprocessed source, gzipped (186.70 KB, application/x-gzip-compressed)
2004-02-01 23:50 UTC, Ralf W. Grosse-Kunstleve
Details
Minimal testcase for this (262 bytes, text/plain)
2004-02-02 20:26 UTC, Daniel Berlin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf W. Grosse-Kunstleve 2004-02-01 23:47:09 UTC
gcc-3_4-branch from 2004/02/01, ca. 12:00pm PST
Configured with: ../gcc-3_4-branch/configure --prefix=/usr/local_cci/gcc-3_4-
branch_2004_02_01_1211 --enable-languages=c,c++
Redhat Linux 8.0

% g++ -fPIC -ftemplate-depth-120 -w -DNDEBUG -O3 -DBOOST_PYTHON_MAX_BASES=2 -
DBOOST_PYTHON_SOURCE -I/net/worm/scratch1/rwgk/hot/boost -
I/usr/include/python2.2 -
E /net/worm/scratch1/rwgk/hot/boost/libs/python/src/dict.cpp > dict_pp.cpp

% g++ -fPIC -ftemplate-depth-120 -O3 -c dict_pp.cpp
In file included 
from /net/worm/scratch1/rwgk/hot/boost/boost/mpl/advance.hpp:20,
                 
from /net/worm/scratch1/rwgk/hot/boost/boost/mpl/aux_/at_impl.hpp:21,
                 from /net/worm/scratch1/rwgk/hot/boost/boost/mpl/at.hpp:22,
                 
from /net/worm/scratch1/rwgk/hot/boost/boost/python/detail/signature.hpp:20,
                 
from /net/worm/scratch1/rwgk/hot/boost/boost/python/detail/caller.hpp:16,
                 
from /net/worm/scratch1/rwgk/hot/boost/boost/python/object/function_handle.hpp:9
,
                 
from /net/worm/scratch1/rwgk/hot/boost/boost/python/converter/arg_to_python.hpp:
20,
                 
from /net/worm/scratch1/rwgk/hot/boost/boost/python/call.hpp:16,
                 
from /net/worm/scratch1/rwgk/hot/boost/boost/python/object_core.hpp:13,
                 
from /net/worm/scratch1/rwgk/hot/boost/boost/python/object.hpp:10,
                 
from /net/worm/scratch1/rwgk/hot/boost/boost/python/dict.hpp:11,
                 
from /net/worm/scratch1/rwgk/hot/boost/libs/python/src/dict.cpp:1:
/net/worm/scratch1/rwgk/hot/boost/boost/mpl/negate.hpp:38: internal compiler 
error: in uses_template_parms, at cp/pt.c:4748
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

I will attach the preprocessed source code. The same file and a tar.gz file 
with the complete boost CVS tree (most current HEAD) are also available here:

http://cci.lbl.gov/~rwgk/bugs/gcc340/dict_pp.cpp.gz

http://cci.lbl.gov/~rwgk/bugs/gcc340/boost_2004_02_01_1526.tar.gz
Comment 1 Ralf W. Grosse-Kunstleve 2004-02-01 23:50:02 UTC
Created attachment 5638 [details]
Preprocessed source, gzipped
Comment 2 Giovanni Bajo 2004-02-02 00:43:26 UTC
Mark, a fallout of your work on uses_template_parms.
Comment 3 Daniel Berlin 2004-02-02 20:26:24 UTC
Created attachment 5653 [details]
Minimal testcase for this

Minimal testcase for this bug.
Verified that patch will fix both this and original code).
Note that the minimal testcase is ice-on-invalid, but it's got the same cause
of failure as the original testcase, which is an identifier_node tree being
passed to uses_template_parms.
Comment 4 Daniel Berlin 2004-02-02 20:27:38 UTC
This patch will fix it, for example. I believe Mark should know what the right thing to do in this case is, 
if not this

Index: pt.c
===============================================================
====
RCS file: /cvs/gcc/gcc/gcc/cp/pt.c,v
retrieving revision 1.821
diff -u -3 -p -r1.821 pt.c
--- pt.c        26 Jan 2004 17:41:50 -0000      1.821
+++ pt.c        2 Feb 2004 20:19:46 -0000
@@ -4744,6 +4744,8 @@ uses_template_parms (tree t)
                   || value_dependent_expression_p (t));
   else if (t == error_mark_node)
     dependent_p = false;
+  else if (TREE_CODE (t) == IDENTIFIER_NODE)
+         dependent_p = false;
   else 
     abort ();
   processing_template_decl = saved_processing_template_decl;
Comment 5 Andrew Pinski 2004-02-03 08:32:15 UTC
: Search converges between 2004-01-27-trunk (#491) and 2004-01-28-trunk (#492).
Comment 6 GCC Commits 2004-02-03 16:12:42 UTC
Subject: Bug 13968

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	mmitchel@gcc.gnu.org	2004-02-03 16:12:33

Modified files:
	gcc            : ChangeLog tree.c tree.h 
	gcc/testsuite/g++.old-deja/g++.robertl: eb125.C 
	gcc/cp         : ChangeLog parser.c pt.c semantics.c 
Added files:
	gcc/testsuite/g++.dg/template: crash17.C koenig4.C 

Log message:
	PR c++/13975
	* tree.h (enum tree_index): Add TI_PUBLIC, TI_PROTECTED, and
	TI_PRIVATE.
	(access_public_node): Redefine.
	(access_protected_node): Likewise.
	(access_private_node): Likewise.
	* tree.c (build_common_tree_nodes): Create access_public_node,
	access_protected_node, and access_private_node.
	
	PR c++/13978
	* pt.c (build_non_dependent_expr): Do not build
	NON_DEPENDENT_EXPRs for FUNCTION_DECLs or TEMPLATE_DECLs.
	
	PR c++/13968
	* semantics.c (finish_id_expression): Do not return an
	IDENTIFIER_NODE when lookup finds a VAR_DECL.
	
	PR c++/13975
	* parser.c (cp_parser_simple_declaration): When skipping to the
	end of the statement swallow the terminating semicolon.
	
	PR c++/13978
	* g++.dg/template/koenig4.C: New test.
	
	PR c++/13968
	* g++.dg/template/crash17.C: New test.
	
	PR c++/13975
	* g++.dg/parse/error13.C: New test.
	* g++.old-deja/g++.robertl/eb125.C: Tweak error messages.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.136&r2=2.2326.2.137
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.342.2.1&r2=1.342.2.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.458&r2=1.458.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb125.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.6&r2=1.6.16.1
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.28&r2=1.3892.2.29
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.157.2.7&r2=1.157.2.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.816.2.7&r2=1.816.2.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.381.4.5&r2=1.381.4.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash17.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/koenig4.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1

Comment 7 GCC Commits 2004-02-03 16:53:35 UTC
Subject: Bug 13968

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-02-03 16:53:28

Modified files:
	gcc            : ChangeLog tree.c tree.h 
	gcc/testsuite/g++.old-deja/g++.robertl: eb125.C 
	gcc/testsuite  : ChangeLog 
	gcc/cp         : ChangeLog parser.c pt.c semantics.c 
Added files:
	gcc/testsuite/g++.dg/template: crash17.C koenig4.C 

Log message:
	PR c++/13975
	* tree.h (enum tree_index): Add TI_PUBLIC, TI_PROTECTED, and
	TI_PRIVATE.
	(access_public_node): Redefine.
	(access_protected_node): Likewise.
	(access_private_node): Likewise.
	* tree.c (build_common_tree_nodes): Create access_public_node,
	access_protected_node, and access_private_node.
	
	PR c++/13978
	* pt.c (build_non_dependent_expr): Do not build
	NON_DEPENDENT_EXPRs for FUNCTION_DECLs or TEMPLATE_DECLs.
	
	PR c++/13968
	* semantics.c (finish_id_expression): Do not return an
	IDENTIFIER_NODE when lookup finds a VAR_DECL.
	
	PR c++/13975
	* parser.c (cp_parser_simple_declaration): When skipping to the
	end of the statement swallow the terminating semicolon.
	
	PR c++/13978
	* g++.dg/template/koenig4.C: New test.
	
	PR c++/13968
	* g++.dg/template/crash17.C: New test.
	
	PR c++/13975
	* g++.dg/parse/error13.C: New test.
	* g++.old-deja/g++.robertl/eb125.C: Tweak error messages.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.2622&r2=2.2623
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.c.diff?cvsroot=gcc&r1=1.344&r2=1.345
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.h.diff?cvsroot=gcc&r1=1.459&r2=1.460
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.robertl/eb125.C.diff?cvsroot=gcc&r1=1.6&r2=1.7
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3457&r2=1.3458
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3925&r2=1.3926
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.165&r2=1.166
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.825&r2=1.826
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&r1=1.386&r2=1.387
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash17.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/koenig4.C.diff?cvsroot=gcc&r1=1.1&r2=1.2

Comment 8 GCC Commits 2004-02-03 16:54:05 UTC
Subject: Bug 13968

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	mmitchel@gcc.gnu.org	2004-02-03 16:53:57

Modified files:
	gcc/testsuite  : ChangeLog 

Log message:
	PR c++/13975
	* tree.h (enum tree_index): Add TI_PUBLIC, TI_PROTECTED, and
	TI_PRIVATE.
	(access_public_node): Redefine.
	(access_protected_node): Likewise.
	(access_private_node): Likewise.
	* tree.c (build_common_tree_nodes): Create access_public_node,
	access_protected_node, and access_private_node.
	
	PR c++/13978
	* pt.c (build_non_dependent_expr): Do not build
	NON_DEPENDENT_EXPRs for FUNCTION_DECLs or TEMPLATE_DECLs.
	
	PR c++/13968
	* semantics.c (finish_id_expression): Do not return an
	IDENTIFIER_NODE when lookup finds a VAR_DECL.
	
	PR c++/13975
	* parser.c (cp_parser_simple_declaration): When skipping to the
	end of the statement swallow the terminating semicolon.
	
	PR c++/13978
	* g++.dg/template/koenig4.C: New test.
	
	PR c++/13968
	* g++.dg/template/crash17.C: New test.
	
	PR c++/13975
	* g++.dg/parse/error13.C: New test.
	* g++.old-deja/g++.robertl/eb125.C: Tweak error messages.

Patches:
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.44&r2=1.3389.2.45

Comment 9 Mark Mitchell 2004-02-03 16:57:44 UTC
Fixed in GCC 3.4.
Comment 10 Mark Mitchell 2004-02-08 19:12:30 UTC
Fixed in GCC 3.4.