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 regression/65054] New: internal compiler error: in maybe_constant_value, at cp/constexpr.c:3646


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

            Bug ID: 65054
           Summary: internal compiler error: in maybe_constant_value, at
                    cp/constexpr.c:3646
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: regression
          Assignee: unassigned at gcc dot gnu.org
          Reporter: holger.hopp at sap dot com

following code throws an internal compiler error with g++-5.0 (gcc-5.0 works):

typedef char * CP;

const char * foo (void)
{
  return ((const CP)"abc"+1);
}

$ g++ -c tst.c 
tst.c: In function âconst char* foo()â:
tst.c:5:28: internal compiler error: in maybe_constant_value, at
cp/constexpr.c:3646
   return ((const CP)"abc"+1);
                            ^
0x83d85d maybe_constant_value(tree_node*, tree_node*)
    ../../gcc/gcc/cp/constexpr.c:3642
0x78a0bc cp_convert_and_check(tree_node*, tree_node*, int)
    ../../gcc/gcc/cp/cvt.c:639
0x636331 convert_like_real
    ../../gcc/gcc/cp/call.c:6565
0x63721c perform_implicit_conversion_flags(tree_node*, tree_node*, int, int)
    ../../gcc/gcc/cp/call.c:9405
0x7779e3 check_return_expr(tree_node*, bool*)
    ../../gcc/gcc/cp/typeck.c:8713
0x7b217e finish_return_stmt(tree_node*)
    ../../gcc/gcc/cp/semantics.c:887
0x735bc8 cp_parser_jump_statement
    ../../gcc/gcc/cp/parser.c:11061
0x735bc8 cp_parser_statement
    ../../gcc/gcc/cp/parser.c:9711
0x736162 cp_parser_statement_seq_opt
    ../../gcc/gcc/cp/parser.c:10099
0x7362bb cp_parser_compound_statement
    ../../gcc/gcc/cp/parser.c:10053
0x74b03b cp_parser_function_body
    ../../gcc/gcc/cp/parser.c:19185
0x74b03b cp_parser_ctor_initializer_opt_and_function_body
    ../../gcc/gcc/cp/parser.c:19221
0x7558ba cp_parser_function_definition_after_declarator
    ../../gcc/gcc/cp/parser.c:23464
0x756733 cp_parser_function_definition_from_specifiers_and_declarator
    ../../gcc/gcc/cp/parser.c:23376
0x756733 cp_parser_init_declarator
    ../../gcc/gcc/cp/parser.c:17055
0x757ccc cp_parser_simple_declaration
    ../../gcc/gcc/cp/parser.c:11592
0x758023 cp_parser_block_declaration
    ../../gcc/gcc/cp/parser.c:11466
0x760599 cp_parser_declaration
    ../../gcc/gcc/cp/parser.c:11363
0x76081a cp_parser_declaration_seq_opt
    ../../gcc/gcc/cp/parser.c:11249
0x760b2f cp_parser_translation_unit
    ../../gcc/gcc/cp/parser.c:4100
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.

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