Bug 19034 - [3.4 Regression] internal compiler error: in cp_tree_equal, at cp/tree.c:1633
Summary: [3.4 Regression] internal compiler error: in cp_tree_equal, at cp/tree.c:1633
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.3
: P2 normal
Target Milestone: 3.4.4
Assignee: Mark Mitchell
URL:
Keywords: ice-on-valid-code, monitored
Depends on:
Blocks:
 
Reported: 2004-12-16 14:07 UTC by Jarkko Toivonen
Modified: 2005-05-05 06:27 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 3.3.5
Known to fail: 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 4.0.0
Last reconfirmed: 2005-02-26 18:42:30


Attachments
source code that doesn't compile (102.79 KB, application/octet-stream)
2004-12-16 14:12 UTC, Jarkko Toivonen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jarkko Toivonen 2004-12-16 14:07:29 UTC
Following command causes an ICE
/home/jttoivon/usr/bin/g++ -v -save-temps poista.cpp
This used to work with 3.3.3 compiler.
Here's the dump.

Reading specs from /home/jttoivon/usr/lib/gcc/i686-pc-linux-gnu/3.4.3/specs
Configured with: /home/jttoivon/gcc-3.4.3/configure --prefix=/home/jttoivon/usr
Thread model: posix
gcc version 3.4.3
 /home/jttoivon/usr/libexec/gcc/i686-pc-linux-gnu/3.4.3/cc1plus -E -quiet -v
-D_GNU_SOURCE poista.cpp -mtune=pentiumpro -o poista.ii
ignoring nonexistent directory
"/home/jttoivon/usr/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/jttoivon/boost_1_31_0
 /home/jttoivon/usr/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../include/c++/3.4.3
 /home/jttoivon/usr/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../include/c++/3.4.3/i686-pc-linux-gnu
 /home/jttoivon/usr/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../include/c++/3.4.3/backward
 /usr/local/include
 /home/jttoivon/usr/include
 /home/jttoivon/usr/lib/gcc/i686-pc-linux-gnu/3.4.3/include
 /usr/include
End of search list.
 /home/jttoivon/usr/libexec/gcc/i686-pc-linux-gnu/3.4.3/cc1plus -fpreprocessed
poista.ii -quiet -dumpbase poista.cpp -mtune=pentiumpro -auxbase poista -version
-o poista.s
GNU C++ version 3.4.3 (i686-pc-linux-gnu)
        compiled by GNU C version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
In file included from poista.cpp:1:
meta.hpp:188: internal compiler error: in cp_tree_equal, at cp/tree.c:1633
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Jarkko Toivonen 2004-12-16 14:12:27 UTC
Created attachment 7757 [details]
source code that doesn't compile
Comment 2 Serge Belyshev 2004-12-16 15:08:26 UTC
// reduced testcase

template< bool C > struct B
{
};

template<typename S> int foo();
template<typename S> int foo1();

template<typename T> struct bar : public B <(sizeof(foo<T>()) == 1)>
{
};

template<typename T> struct bar1 : public B <(sizeof(foo1<T>()) == 1)>
{
};
Comment 3 Serge Belyshev 2004-12-16 15:20:14 UTC
: Search converges between 2003-06-18-trunk (#268) and 2003-06-19-trunk (#269).
Comment 4 Volker Reichelt 2004-12-17 20:59:43 UTC
Nathan, this was caused by your patch
http://gcc.gnu.org/ml/gcc-cvs/2003-06/msg00871.html

Apparently we have a tcc_exceptional in the last switch
statement of cp_tree_equal so that we hit gcc_unreachable.

I don't know whether tcc_exceptional should be handled more
gracefully or whether it shouldn't appear there at all.
Comment 5 Mark Mitchell 2004-12-21 20:25:37 UTC
Working on a fix.
Comment 6 CVS Commits 2004-12-22 03:35:10 UTC
Subject: Bug 19034

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-12-22 03:34:59

Modified files:
	gcc/cp         : ChangeLog call.c decl.c parser.c tree.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/ext: packed8.C 
	gcc/testsuite/g++.dg/template: crash31.C crash30.C 

Log message:
	PR c++/18378
	* call.c (convert_like_real): Do not permit the use of a copy
	constructor to copy a packed field.
	
	PR c++/17413
	* decl.c (grokdeclarator): Return error_mark_node, not
	void_type_node, to indicate errors.
	* parser.c (cp_parser_template_parameter_list): Robustify.
	(cp_parser_template_parameter): Likewise.
	
	PR c++/19034
	* tree.c (cp_tree_equal): Handle OVERLOAD.
	
	PR c++/18378
	* g++.dg/ext/packed8.C: New test.
	
	PR c++/13268
	* g++.dg/template/crash31.C: New test.
	
	PR c++/19034
	* g++.dg/template/crash30.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4550&r2=1.4551
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&r1=1.523&r2=1.524
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1345&r2=1.1346
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.296&r2=1.297
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/tree.c.diff?cvsroot=gcc&r1=1.420&r2=1.421
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/packed8.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash31.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash30.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4796&r2=1.4797

Comment 7 Mark Mitchell 2004-12-22 03:39:25 UTC
Fixed in GCC 4.0.
Comment 8 Andreas Jaeger 2004-12-28 16:38:33 UTC
It's fixed 
Comment 9 Volker Reichelt 2005-01-05 14:25:35 UTC
Not fixed on the 3.4 branch.
Comment 10 CVS Commits 2005-05-05 05:47:05 UTC
Subject: Bug 19034

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	mmitchel@gcc.gnu.org	2005-05-05 05:45:55

Modified files:
	gcc/cp         : ChangeLog tree.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: crash30.C 

Log message:
	Backport:
	2004-12-21  Mark Mitchell  <mark@codesourcery.com>
	PR c++/19034
	* tree.c (cp_tree_equal): Handle OVERLOAD.
	
	Backport:
	2004-12-21  Mark Mitchell  <mark@codesourcery.com>
	PR c++/19034
	* g++.dg/template/crash30.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.216&r2=1.3892.2.217
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/tree.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.360.4.12&r2=1.360.4.13
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.390&r2=1.3389.2.391
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash30.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.34.1

Comment 11 Mark Mitchell 2005-05-05 06:27:51 UTC
Fixed in 3.4.4.