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

            Bug ID: 82023
           Summary: [arm] constexpr ICE: in cxx_eval_constant_expression,
                    at cp/constexpr.c:4556
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nsz at gcc dot gnu.org
  Target Milestone: ---

following c++14 code fails to compile with ice on arm targets:

struct A {
  constexpr A() {
    return;
  }
};

A x;

$ arm-none-linux-gnueabihf-g++ -S foo.cpp
foo.cpp:7:3:   in constexpr expansion of ‘x.A::A()’
foo.cpp:7:3: internal compiler error: in cxx_eval_constant_expression, at
cp/constexpr.c:4556
 A x;
   ^
0x6777c3 cxx_eval_constant_expression
        /S/gcc/cp/constexpr.c:4556
0x677a37 cxx_eval_statement_list
        /S/gcc/cp/constexpr.c:3770
0x677a37 cxx_eval_constant_expression
        /S/gcc/cp/constexpr.c:4497
0x67728b cxx_eval_constant_expression
        /S/gcc/cp/constexpr.c:4503
0x677a37 cxx_eval_statement_list
        /S/gcc/cp/constexpr.c:3770
0x677a37 cxx_eval_constant_expression
        /S/gcc/cp/constexpr.c:4497
0x675f4f cxx_eval_call_expression
        /S/gcc/cp/constexpr.c:1661
0x67723f cxx_eval_constant_expression
        /S/gcc/cp/constexpr.c:4035
0x670d33 cxx_eval_outermost_constant_expr
        /S/gcc/cp/constexpr.c:4667
0x67ee57 maybe_constant_init(tree_node*, tree_node*)
        /S/gcc/cp/constexpr.c:4990
0x72b9a7 expand_default_init
        /S/gcc/cp/init.c:1869
0x72b9a7 expand_aggr_init_1
        /S/gcc/cp/init.c:1972
0x72c05f build_aggr_init(tree_node*, tree_node*, int, int)
        /S/gcc/cp/init.c:1713
0x6c14ff build_aggr_init_full_exprs
        /S/gcc/cp/decl.c:6094
0x6c14ff check_initializer
        /S/gcc/cp/decl.c:6242
0x6e205f cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        /S/gcc/cp/decl.c:6961
0x7b50df cp_parser_init_declarator
        /S/gcc/cp/parser.c:19674
0x7b7b4b cp_parser_simple_declaration
        /S/gcc/cp/parser.c:13051
0x7b8a1f cp_parser_block_declaration
        /S/gcc/cp/parser.c:12877
0x7c1063 cp_parser_declaration
        /S/gcc/cp/parser.c:12774
Please submit a full bug report,
with preprocessed source if appropriate.

the assert is

 4554    case GOTO_EXPR:                            
 4555      *jump_target = TREE_OPERAND (t, 0);      
 4556      gcc_assert (breaks (jump_target) || continues (jump_target));
 4557      break;                                   

the -tree-original output is unexpected on arm:

;; Function constexpr A::A() (null)
;; enabled by -tree-original


{
  // predicted unlikely by goto predictor.;
  goto <D.5928>;
}
<D.5928>:;
return this;


e.g. on aarch64 it's:

;; Function constexpr A::A() (null)
;; enabled by -tree-original


{
  return;
}

Reply via email to