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

            Bug ID: 70571
           Summary: ICE on valid code on x86_64-linux-gnu in
                    verify_ctor_sanity, at cp/constexpr.c:2259
           Product: gcc
           Version: 6.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 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 5.3.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/6.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 6.0.0 20160406 (experimental) [trunk revision 234771] (GCC) 
$ 
$ g++-5.3 -c small.cpp
$    
$ g++-trunk -c small.cpp
small.cpp: In function ‘void foo(vec, vec, int)’:
small.cpp:4:14: internal compiler error: in verify_ctor_sanity, at
cp/constexpr.c:2348
   x = (z == y);
              ^
0x845da7 verify_ctor_sanity
        ../../gcc-source-trunk/gcc/cp/constexpr.c:2347
0x85314f cxx_eval_bare_aggregate
        ../../gcc-source-trunk/gcc/cp/constexpr.c:2382
0x84ddb0 cxx_eval_constant_expression
        ../../gcc-source-trunk/gcc/cp/constexpr.c:3862
0x85192d cxx_eval_binary_expression
        ../../gcc-source-trunk/gcc/cp/constexpr.c:1716
0x84d414 cxx_eval_constant_expression
        ../../gcc-source-trunk/gcc/cp/constexpr.c:3795
0x854639 cxx_eval_outermost_constant_expr
        ../../gcc-source-trunk/gcc/cp/constexpr.c:4110
0x855c8b potential_constant_expression_1
        ../../gcc-source-trunk/gcc/cp/constexpr.c:5093
0x741eb4 cp_parser_constant_expression
        ../../gcc-source-trunk/gcc/cp/parser.c:9334
0x742614 cp_parser_initializer_clause
        ../../gcc-source-trunk/gcc/cp/parser.c:20793
0x741c91 cp_parser_assignment_expression
        ../../gcc-source-trunk/gcc/cp/parser.c:9074
0x744329 cp_parser_expression
        ../../gcc-source-trunk/gcc/cp/parser.c:9222
0x744a9f cp_parser_expression_statement
        ../../gcc-source-trunk/gcc/cp/parser.c:10683
0x7327eb cp_parser_statement
        ../../gcc-source-trunk/gcc/cp/parser.c:10534
0x73349c cp_parser_statement_seq_opt
        ../../gcc-source-trunk/gcc/cp/parser.c:10806
0x73358f cp_parser_compound_statement
        ../../gcc-source-trunk/gcc/cp/parser.c:10760
0x751dcf cp_parser_function_body
        ../../gcc-source-trunk/gcc/cp/parser.c:20653
0x751dcf cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc-source-trunk/gcc/cp/parser.c:20689
0x752871 cp_parser_function_definition_after_declarator
        ../../gcc-source-trunk/gcc/cp/parser.c:25351
0x753467 cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc-source-trunk/gcc/cp/parser.c:25263
0x753467 cp_parser_init_declarator
        ../../gcc-source-trunk/gcc/cp/parser.c:18429
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.
$ 


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


typedef int vec __attribute__ ((vector_size (sizeof (int))));
void foo (vec x, vec y, int z)
{
  x = (z == y);
}

Reply via email to