public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/42069]  New: 4.5 fails
@ 2009-11-16 19:26 nthomas at cs dot tamu dot edu
  2009-11-16 19:58 ` [Bug c++/42069] [4.5 Regression] fails on class template specialization with default parameter pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: nthomas at cs dot tamu dot edu @ 2009-11-16 19:26 UTC (permalink / raw)
  To: gcc-bugs

The following code generates an tree check error in cp/pt.c of gcc 4.5 trunk
(11/15/2009).  This is a kernel that reproduces the error in a larger project. 
Both the kernel and original code compile and run correctly in previous
versions of gcc.

template<typename T>
struct A
{
  static const int size = 1;
};


template<int Integral>
struct B
{
  typedef int type;
};


template<typename T>
struct C
{
  typedef int type;
};


template<typename X, typename Y = void>
struct D
{
  typedef typename C<X>::type        T;
  typedef A<T>                       AT;
  typedef typename B<AT::size>::type type;
};


template<typename X> 
struct D<X&, void>
{
  typedef typename C<X>::type        T;
  typedef A<T>                       AT;
  typedef typename B<AT::size>::type type;
};

main()
{
  D<bool&> t;
}


gcc -v -save-temps -o test test.cc             
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/gnu/gcc-4.5.trunk.10.14.09/libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../gcc.trunk/configure --enable-languages=c++
--prefix=/usr/local/gnu/gcc-4.5.trunk.10.14.09
--with-mpfr=/usr/local/gnu/mpfr-2.4.1
Thread model: posix
gcc version 4.5.0 20091110 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-o' 'test' '-mtune=generic'

/usr/local/gnu/gcc-4.5.trunk.10.14.09/libexec/gcc/i686-pc-linux-gnu/4.5.0/cc1plus
-E -quiet -v -D_GNU_SOURCE test.cc -mtune=generic -fpch-preprocess -o test.ii
ignoring nonexistent directory
"/usr/local/gnu/gcc-4.5.trunk.10.14.09/lib/gcc/i686-pc-linux-gnu/4.5.0/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/usr/local/gnu/gcc-4.5.trunk.10.14.09/lib/gcc/i686-pc-linux-gnu/4.5.0/../../../../include/c++/4.5.0

/usr/local/gnu/gcc-4.5.trunk.10.14.09/lib/gcc/i686-pc-linux-gnu/4.5.0/../../../../include/c++/4.5.0/i686-pc-linux-gnu

/usr/local/gnu/gcc-4.5.trunk.10.14.09/lib/gcc/i686-pc-linux-gnu/4.5.0/../../../../include/c++/4.5.0/backward
 /usr/local/include
 /usr/local/gnu/gcc-4.5.trunk.10.14.09/include
 /usr/local/gnu/gcc-4.5.trunk.10.14.09/lib/gcc/i686-pc-linux-gnu/4.5.0/include

/usr/local/gnu/gcc-4.5.trunk.10.14.09/lib/gcc/i686-pc-linux-gnu/4.5.0/include-fixed
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-o' 'test' '-mtune=generic'

/usr/local/gnu/gcc-4.5.trunk.10.14.09/libexec/gcc/i686-pc-linux-gnu/4.5.0/cc1plus
-fpreprocessed test.ii -quiet -dumpbase test.cc -mtune=generic -auxbase test
-version -o test.s
GNU C++ (GCC) version 4.5.0 20091110 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.5.0 20091110 (experimental), GMP version
4.3.1, MPFR version 2.4.1-p5
warning: GMP header version 4.3.1 differs from library version 4.1.4.
warning: MPFR header version 2.4.1-p5 differs from library version 2.3.0.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C++ (GCC) version 4.5.0 20091110 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.5.0 20091110 (experimental), GMP version
4.3.1, MPFR version 2.4.1-p5
warning: GMP header version 4.3.1 differs from library version 4.1.4.
warning: MPFR header version 2.4.1-p5 differs from library version 2.3.0.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: a2f4d0ba16c13073ade98a90c4f4dd49
test.cc: In instantiation of 'D<bool&>':
test.cc:41:12:   instantiated from here
test.cc:36:38: internal compiler error: tree check: accessed elt 2 of tree_vec
with 1 elts in tsubst, at cp/pt.c:9721
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


-- 
           Summary: 4.5 fails
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: nthomas at cs dot tamu dot edu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42069


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-12-11 23:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-16 19:26 [Bug c++/42069] New: 4.5 fails nthomas at cs dot tamu dot edu
2009-11-16 19:58 ` [Bug c++/42069] [4.5 Regression] fails on class template specialization with default parameter pinskia at gcc dot gnu dot org
2009-11-27 11:21 ` rguenth at gcc dot gnu dot org
2009-11-29 18:39 ` reichelt at gcc dot gnu dot org
2009-11-29 19:42 ` [Bug c++/42069] [4.5 Regression] ICE on class template specialization dodji at gcc dot gnu dot org
2009-11-29 23:42 ` dodji at gcc dot gnu dot org
2009-11-30  9:58 ` dodji at gcc dot gnu dot org
2009-11-30 10:15 ` dodji at gcc dot gnu dot org
2009-12-11 23:41 ` hjl at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).