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

            Bug ID: 71630
           Summary: ICE on valid C++14 code with variable templates: in
                    get, at cgraph.h:395
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

The following C++11 code causes an ICE when compiled with the current GCC trunk
on x86_64-linux-gnu in both 32-bit and 64-bit modes.  

This is a regression from 6.1.x.


$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 7.0.0 20160622 (experimental) [trunk revision 237715] (GCC) 
$ 
$ g++-6.1 -c -std=c++14 small.cpp
$ clang++ -c -std=c++14 small.cpp
$ 
$ g++-trunk -c -std=c++14 small.cpp
small.cpp:3:23: internal compiler error: in get, at cgraph.h:395
 template int a < int >;
                       ^
0x10c32ab symtab_node::get(tree_node const*)
        ../../gcc-source-trunk/gcc/cgraph.h:392
0x10c32ab varpool_node::get(tree_node const*)
        ../../gcc-source-trunk/gcc/cgraph.h:2480
0x10c32ab varpool_node::get_create(tree_node*)
        ../../gcc-source-trunk/gcc/varpool.c:144
0x764d23 var_finalized_p
        ../../gcc-source-trunk/gcc/cp/decl2.c:1971
0x764d23 c_parse_final_cleanups()
        ../../gcc-source-trunk/gcc/cp/decl2.c:4807
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.
$ 


-------------------------------------


template < typename > extern int a; 
template < typename > int a = 1;
template int a < int >;

Reply via email to