Bug 40274 - [4.5 Regression] Revision 145566 caused ICE in tsubst, at cp/pt.c:9289
Summary: [4.5 Regression] Revision 145566 caused ICE in tsubst, at cp/pt.c:9289
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: 4.5.0
Assignee: Jason Merrill
URL:
Keywords: ice-on-valid-code, monitored
Depends on:
Blocks:
 
Reported: 2009-05-27 16:02 UTC by Jan van Dijk
Modified: 2009-06-30 00:56 UTC (History)
4 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-06-27 00:47:33


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan van Dijk 2009-05-27 16:02:56 UTC
When I compile the reduced testcase below *with -g*, I get:
$ g++ -g  example_valuelist.ii
example_valuelist.ii:5: internal compiler error: in tsubst, at cp/pt.c:9289

Without -g, it is accepted. With 3.4.1, the code worked w and w/ -g.

template <class T> struct valuelist_types
{
 struct null { };
 template <T V, class next=null> struct list { };
};

template <unsigned D> void foo()
{
 typename valuelist_types<unsigned>::template list<D> v;
}

void bar()
{
 valuelist_types<unsigned>::list<2> v;
}
Comment 1 Jan van Dijk 2009-05-27 16:05:38 UTC
I forgot to mention that the ICE disappears when I remove *either* the function template foo, or the function bar.
Comment 2 Volker Reichelt 2009-06-26 06:19:13 UTC
Confirmed.
The bug apeeared between 2009-03-28 and 2009-04-24.
Comment 3 H.J. Lu 2009-06-27 00:43:03 UTC
It was introduced revision 145565 and 145569.
Comment 4 H.J. Lu 2009-06-27 00:45:34 UTC
It is caused by revision 145566:

http://gcc.gnu.org/ml/gcc-cvs/2009-04/msg00188.html
Comment 5 Jason Merrill 2009-06-29 23:16:02 UTC
Subject: Bug 40274

Author: jason
Date: Mon Jun 29 23:15:43 2009
New Revision: 149066

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149066
Log:
	PR c++/40274
	* error.c (dump_template_parms): Pass all args to
	count_non_default_template_args.
	(count_non_default_template_args): Pull out the inner ones.

Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/error.c

Comment 6 Jason Merrill 2009-06-29 23:18:57 UTC
Subject: Bug 40274

Author: jason
Date: Mon Jun 29 23:18:46 2009
New Revision: 149067

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149067
Log:
	PR c++/40274
	* error.c (dump_template_parms): Pass all args to
	count_non_default_template_args.
	(count_non_default_template_args): Pull out the inner ones.

Added:
    trunk/gcc/testsuite/g++.dg/template/debug1.C
Modified:
    trunk/gcc/testsuite/ChangeLog

Comment 7 Jason Merrill 2009-06-30 00:56:56 UTC
Fixed.
Comment 8 hjl@gcc.gnu.org 2009-06-30 13:56:03 UTC
Subject: Bug 40274

Author: hjl
Date: Tue Jun 30 13:55:43 2009
New Revision: 149097

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149097
Log:
2009-06-30  H.J. Lu  <hongjiu.lu@intel.com>

	Backport from mainline:
	2009-06-30  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/40582
	* gcc.c-torture/compile/pr40582.c: New test.

	2009-06-29  Jason Merrill  <jason@redhat.com>

	PR c++/40274
	* g++.dg/template/debug1.C: New.

	2009-06-25  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/40493
	* gcc.c-torture/execute/pr40493.c: New test.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/debug1.C
      - copied unchanged from r149095, trunk/gcc/testsuite/g++.dg/template/debug1.C
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr40582.c
      - copied unchanged from r149095, trunk/gcc/testsuite/gcc.c-torture/compile/pr40582.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/execute/pr40493.c
      - copied unchanged from r149096, trunk/gcc/testsuite/gcc.c-torture/execute/pr40493.c
Modified:
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog