Bug 43704 - [4.5 Regression] ICE: tree check: accessed elt 2 of tree_vec with 1 elts in tsubst, at cp/pt.c:10074
Summary: [4.5 Regression] ICE: tree check: accessed elt 2 of tree_vec with 1 elts in t...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.5.0
: P2 normal
Target Milestone: 4.5.1
Assignee: Dodji Seketeli
URL:
Keywords: ice-on-valid-code
: 43822 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-04-09 15:07 UTC by Richard Biener
Modified: 2010-04-20 19:40 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.4.3
Known to fail: 4.5.0
Last reconfirmed: 2010-04-15 19:08:18


Attachments
autoreduced testcase (4.27 KB, text/plain)
2010-04-09 15:08 UTC, Richard Biener
Details
More reduced (52.35 KB, text/plain)
2010-04-09 19:15 UTC, Andrew Pinski
Details
More reduced (1.03 KB, text/plain)
2010-04-09 19:20 UTC, Andrew Pinski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2010-04-09 15:07:21 UTC
> g++-4.5 -S bug-593923_integrals.3.ii
bug-593923_integrals.3.ii: In instantiation of 'boost::numeric::ublas::banded_adaptor<boost::numeric::ublas::matrix<double> >::iterator1':
bug-593923_integrals.3.ii:500:50:   instantiated from 'void lsp::singular_decomposition<T>::apply(M1&, M2&) const [with M1 = boost::numeric::ublas::matrix<double>, M2 = boost::numeric::ublas::matrix<double>, T = boost::numeric::ublas::matrix<double>]'
bug-593923_integrals.3.ii:555:27:   instantiated from here
bug-593923_integrals.3.ii:467:17: internal compiler error: tree check: accessed elt 2 of tree_vec with 1 elts in tsubst, at cp/pt.c:10074
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Richard Biener 2010-04-09 15:08:17 UTC
Created attachment 20347 [details]
autoreduced testcase
Comment 2 Andrew Pinski 2010-04-09 19:15:10 UTC
Created attachment 20350 [details]
More reduced
Comment 3 Andrew Pinski 2010-04-09 19:20:25 UTC
Created attachment 20351 [details]
More reduced
Comment 4 Andrew Pinski 2010-04-09 19:44:07 UTC
Fully reduced:
 template<       typename T2    , typename T3      > struct if_ {
      typedef T2 type;
 };
template<class I1>     struct iterator_restrict_traits { };
template<class T>     class matrix  {
 class ci {};
 class i {};
};
template<class M, class TRI>     struct triangular_adaptor  {
   typedef typename if_<typename M::ci,typename M::i>::type ty1;
   class iterator2 :    iterator_restrict_traits<typename ty1::ic>::iterator_category  { };
};
template<class M>     struct banded_adaptor  {
  typedef typename if_<typename M::ci,typename M::i>::type ty1;
  class iterator1 :  iterator_restrict_traits<typename ty1::ic>::iterator_category  { };
};
template<class T>
struct singular_decomposition {
  banded_adaptor< matrix< double > >::iterator1 it1;
};
Comment 5 H.J. Lu 2010-04-15 14:57:40 UTC
The failure of the testcase in comment #1 is caused
by revision 145440:

http://gcc.gnu.org/ml/gcc-cvs/2009-04/msg00060.html
Comment 6 Dodji Seketeli 2010-04-15 21:13:57 UTC
A patch was posted to http://gcc.gnu.org/ml/gcc-patches/2010-04/msg00928.html
Comment 7 Dodji Seketeli 2010-04-19 09:32:28 UTC
Subject: Bug 43704

Author: dodji
Date: Mon Apr 19 09:32:16 2010
New Revision: 158508

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158508
Log:
Fix PR c++/43704

gcc/cp/ChangeLog:
	PR c++/43704
	* typeck.c (structural_comptypes): Test dependent typedefs
	incompatibility before testing for their main variant based
	equivalence.

gcc/testsuite/ChangeLog:
	PR c++/43704
	* g++.dg/template/typedef32.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/template/typedef32.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/typeck.c
    trunk/gcc/testsuite/ChangeLog

Comment 8 H.J. Lu 2010-04-19 14:44:29 UTC
On Linux/ia32, I got

Executing on host: /export/gnu/import/svn/gcc-test/bld/gcc/testsuite/g++2/../../g++ -B/export/gnu/import/svn/gcc-test/bld/gcc/testsuite/g++2/../../ /export/gnu/import/svn/gcc-test/src-trunk/gcc/testsuite/g++.dg/template/typedef32.C  -nostdinc++ -I/export/gnu/import/svn/gcc-test/bld/i686-pc-linux-gnu/libstdc++-v3/include/i686-pc-linux-gnu -I/export/gnu/import/svn/gcc-test/bld/i686-pc-linux-gnu/libstdc++-v3/include -I/export/gnu/import/svn/gcc-test/src-trunk/libstdc++-v3/libsupc++ -I/export/gnu/import/svn/gcc-test/src-trunk/libstdc++-v3/include/backward -I/export/gnu/import/svn/gcc-test/src-trunk/libstdc++-v3/testsuite/util -fmessage-length=0   -ansi -pedantic-errors -Wno-long-long  -S  -o typedef32.s    (timeout = 300)
/export/gnu/import/svn/gcc-test/src-trunk/gcc/testsuite/g++.dg/template/typedef32.C: In instantiation of 'banded_adaptor<matrix<double> >::iterator1':^M
/export/gnu/import/svn/gcc-test/src-trunk/gcc/testsuite/g++.dg/template/typedef32.C:43:46:   instantiated from here^M
/export/gnu/import/svn/gcc-test/src-trunk/gcc/testsuite/g++.dg/template/typedef32.C:35:9: error: no type named 'ic' in 'class banded_adaptor<matrix<double> >::ty1'^M
Comment 9 Andrew Pinski 2010-04-20 18:10:17 UTC
*** Bug 43822 has been marked as a duplicate of this bug. ***
Comment 10 Dodji Seketeli 2010-04-20 19:24:04 UTC
Subject: Bug 43704

Author: dodji
Date: Tue Apr 20 19:23:45 2010
New Revision: 158571

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158571
Log:
Fix PR c++/43800

gcc/cp/ChangeLog:
	PR c++/43800
	PR c++/43704
	* typeck.c (incompatible_dependent_types_p): If one of the
	compared types if not a typedef then honour their main variant
	equivalence.

gcc/testsuite/ChangeLog:
	PR c++/43800
	PR c++/43704
	* g++.dg/template/typedef32.C: Adjust.
	* g++.dg/template/typedef33.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/template/typedef33.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/typeck.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/template/typedef32.C

Comment 11 Dodji Seketeli 2010-04-20 19:40:31 UTC
Fixed in trunk (4.6) and 4.5.1.
Comment 12 Dodji Seketeli 2010-04-20 19:40:32 UTC
Subject: Bug 43704

Author: dodji
Date: Tue Apr 20 19:40:11 2010
New Revision: 158572

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158572
Log:
Fix PR c++/43704

gcc/cp/ChangeLog:
	PR c++/43704
	* typeck.c (structural_comptypes): Test dependent typedefs
	incompatibility before testing for their main variant based
	equivalence.
	(incompatible_dependent_types_p): If one of the
	compared types if not a typedef then honour their main variant
	equivalence.

gcc/testsuite/ChangeLog:
	PR c++/43704
	* g++.dg/template/typedef32.C: New test.
	* g++.dg/template/typedef33.C: New test.


gcc/testsuite/ChangeLog:

Added:
    branches/gcc-4_5-branch/gcc/testsuite/g++.dg/template/typedef32.C
    branches/gcc-4_5-branch/gcc/testsuite/g++.dg/template/typedef33.C
Modified:
    branches/gcc-4_5-branch/gcc/cp/ChangeLog
    branches/gcc-4_5-branch/gcc/cp/typeck.c
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog