This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/59641] New: ICE with invalid expression in vector arithmetic


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

            Bug ID: 59641
           Summary: ICE with invalid expression in vector arithmetic
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org

The following invalid code snippet (compiled with "-std=c++11")
triggers an ICE since GCC 4.8.0:

======================================================
typedef int T __attribute__((vector_size(8)));

T foo(const T& a, const T& b)
{
  constexpr T c = a < b;
  return c ? a : b;
}
======================================================

bug.cc: In function 'T foo(const T&, const T&)':
bug.cc:5:23: error: 'a' is not a constant expression
   constexpr T c = a < b;
                       ^
bug.cc:6:18: internal compiler error: tree check: expected vector_type, have
error_mark in build_conditional_expr_1, at cp/call.c:4495
   return c ? a : b;
                  ^
0xd8f084 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/gcc/tree.c:9192
0x58441c tree_check
        ../../gcc/gcc/tree.h:2707
0x58441c build_conditional_expr_1
        ../../gcc/gcc/cp/call.c:4495
0x5844bc build_conditional_expr(unsigned int, tree_node*, tree_node*,
tree_node*, int)
        ../../gcc/gcc/cp/call.c:4931
0x6a8e53 build_x_conditional_expr(unsigned int, tree_node*, tree_node*,
tree_node*, int)
        ../../gcc/gcc/cp/typeck.c:6017
0x682b2c cp_parser_question_colon_clause
        ../../gcc/gcc/cp/parser.c:8080
0x682b2c cp_parser_assignment_expression
        ../../gcc/gcc/cp/parser.c:8116
0x6847b4 cp_parser_expression
        ../../gcc/gcc/cp/parser.c:8274
0x67af3a cp_parser_expression
        ../../gcc/gcc/cp/parser.c:8313
0x67af3a cp_parser_jump_statement
        ../../gcc/gcc/cp/parser.c:10677
0x67af3a cp_parser_statement
        ../../gcc/gcc/cp/parser.c:9370
0x67b5c9 cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:9740
0x67b73e cp_parser_compound_statement
        ../../gcc/gcc/cp/parser.c:9694
0x68f15b cp_parser_function_body
        ../../gcc/gcc/cp/parser.c:18610
0x68f15b cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/gcc/cp/parser.c:18646
0x6934fe cp_parser_function_definition_after_declarator
        ../../gcc/gcc/cp/parser.c:22678
0x694394 cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/gcc/cp/parser.c:22590
0x694394 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:16588
0x69562f cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:11200
0x679003 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:11081
Please submit a full bug report, [etc.]


Marc, vector arithmetic looks like your domain, would you mind having a look?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]