https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61392

            Bug ID: 61392
           Summary: internal compiler error: in
                    write_template_arg_literal, at cp/mangle.c:3072
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cas43 at cs dot stanford.edu

THIS PROGRAM:


template<class T> struct A { };
template<class S,class T> struct B
{
    A<int> ddx;
    template<class U,class V> decltype(f(A<U>(),ddx)) operator-(B<U,V>) const;
};
B<int,int> f(A<int>,A<int>);
B<int,int> x,y=x-x;


CAUSES THIS OUTPUT:


prog.cpp: In instantiation of ‘decltype (f(A<U>(), ((B<S, T>*)(void)0)->B<S,
T>::ddx)) B<S, T>::operator-(B<U, V>) const [with U = int; V = int; S = int; T
= int; decltype (f(A<U>(), ((B<S, T>*)(void)0)->B<S, T>::ddx)) = B<int, int>]’:

prog.cpp:5:55: internal compiler error: in write_template_arg_literal, at
cp/mangle.c:3072
     template<class U,class V> decltype(f(A<U>(),ddx)) operator-(B<U,V>) const;
                                                       ^
0x72af8b write_template_arg_literal
    ../../s-trunk/gcc/cp/mangle.c:3072
0x72522f write_expression
    ../../s-trunk/gcc/cp/mangle.c:3008
0x7262b8 write_expression
    ../../s-trunk/gcc/cp/mangle.c:2900
0x724ed4 write_expression
    ../../s-trunk/gcc/cp/mangle.c:2955
0x7289cc write_type
    ../../s-trunk/gcc/cp/mangle.c:2106
0x72a5d4 write_bare_function_type
    ../../s-trunk/gcc/cp/mangle.c:2443
0x72ced9 mangle_decl_string
    ../../s-trunk/gcc/cp/mangle.c:3443
0x72d117 get_mangled_id
    ../../s-trunk/gcc/cp/mangle.c:3465
0x72d117 mangle_decl(tree_node*)
    ../../s-trunk/gcc/cp/mangle.c:3488
0xdab370 decl_assembler_name(tree_node*)
    ../../s-trunk/gcc/tree.c:602
0x83b864 insert_to_assembler_name_hash
    ../../s-trunk/gcc/symtab.c:183
0x83b9c1 symtab_initialize_asm_name_hash
    ../../s-trunk/gcc/symtab.c:359
0x84a964 analyze_functions
    ../../s-trunk/gcc/cgraphunit.c:1135
0x84bea5 finalize_compilation_unit()
    ../../s-trunk/gcc/cgraphunit.c:2331
0x63b03e cp_write_global_declarations()
    ../../s-trunk/gcc/cp/decl2.c:4647
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


WITH THIS COMPILER:


Using built-in specs.
COLLECT_GCC=/home/craig/new-gcc/i-trunk/bin/g++
COLLECT_LTO_WRAPPER=/home/craig/new-gcc/i-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.10.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../s-trunk/configure --prefix=/home/craig/new-gcc/i-trunk
Thread model: posix
gcc version 4.10.0 20140602 (experimental) (GCC) 



WHEN RUN LIKE THIS:


g++ -c --std=c++0x  prog.cpp


BUT COMPILES CLEANLY WHEN RUN THE SAME WAY WITH THIS COMPILER:


Using built-in specs.
COLLECT_GCC=g++-4.8
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
4.8.1-2ubuntu1~12.04' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs
--enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.8 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls
--with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin
--with-system-zlib --disable-browser-plugin --enable-java-awt=gtk
--enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre
--enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686
--with-abi=m64 --with-multilib-list=m32,m64 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.1 (Ubuntu 4.8.1-2ubuntu1~12.04)

Reply via email to