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++/71092] [6/7 Regression] ICE: in cxx_eval_call_expression, at cp/constexpr.c:1449; only with -Os


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

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-05-13
                 CC|                            |trippels at gcc dot gnu.org
            Summary|internal compiler error: in |[6/7 Regression] ICE: in
                   |cxx_eval_call_expression,   |cxx_eval_call_expression,
                   |at cp/constexpr.c:1449;     |at cp/constexpr.c:1449;
                   |only with -Os               |only with -Os
     Ever confirmed|0                           |1

--- Comment #2 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
markus@x4 tmp % cat prep.cpp
template <typename _Default> struct A { using type = _Default; };
template <typename _Default, template <typename> typename>
using __detected_or = A<_Default>;
template <typename _Default, template <typename> class _Op>
using __detected_or_t = typename __detected_or<_Default, _Op>::type;
template <typename _Tp> struct B { typedef _Tp value_type; };
struct C {
  template <typename _Tp> using __pointer = typename _Tp::pointer;
};
template <typename _Alloc> struct J : C {
  using pointer = __detected_or_t<typename _Alloc::value_type *, __pointer>;
};
template <typename _T1> void _Construct(_T1 *) { new _T1; }
struct D {
  template <typename _ForwardIterator, typename _Size>
  static _ForwardIterator __uninit_default_n(_ForwardIterator p1, _Size) {
    _Construct(p1);
  }
};
template <typename _ForwardIterator, typename _Size>
void __uninitialized_default_n(_ForwardIterator p1, _Size) {
  D::__uninit_default_n(p1, 0);
}
template <typename _ForwardIterator, typename _Size, typename _Tp>
void __uninitialized_default_n_a(_ForwardIterator p1, _Size, _Tp) {
  __uninitialized_default_n(p1, 0);
}
template <typename> struct __shared_ptr {
  constexpr __shared_ptr() : _M_ptr(), _M_refcount() {}
  int _M_ptr;
  int _M_refcount;
};
template <typename _Alloc> struct F {
  typedef _Alloc _Tp_alloc_type;
  struct G {
    typename J<_Tp_alloc_type>::pointer _M_start;
    G(_Tp_alloc_type);
  };
  F(int, _Alloc p2) : _M_impl(p2) {}
  G _M_impl;
};
template <typename _Tp, typename _Alloc = B<_Tp>> struct K : F<_Alloc> {
  typedef _Alloc allocator_type;
  K(int, allocator_type p2 = allocator_type()) : F<_Alloc>(0, p2) {
    __uninitialized_default_n_a(this->_M_impl._M_start, 0, 0);
  }
};
struct H {
  H();
  struct I {
    __shared_ptr<int> trigger[1];
  };
  __shared_ptr<int> resetTrigger_;
  K<I> states_;
  __shared_ptr<int> triggerManager_;
};
__shared_ptr<int> a;
H::H() : states_(0), triggerManager_(a) {}

markus@x4 tmp % g++ -c prep.cpp -Os
prep.cpp: In constructor âconstexpr H::I::I()â:
prep.cpp:50:10:   in constexpr expansion of â__shared_ptr<int>()â
prep.cpp:50:10: internal compiler error: in cxx_eval_call_expression, at
cp/constexpr.c:1449
   struct I {
          ^
0x863b2d cxx_eval_call_expression
        ../../gcc/gcc/cp/constexpr.c:1449
0x864863 cxx_eval_constant_expression
        ../../gcc/gcc/cp/constexpr.c:3557
0x86a51b cxx_eval_outermost_constant_expr
        ../../gcc/gcc/cp/constexpr.c:4135
0x86d371 maybe_constant_init(tree_node*, tree_node*)
        ../../gcc/gcc/cp/constexpr.c:4453
0x7b1664 build_vec_init(tree_node*, tree_node*, tree_node*, bool, int, int)
        ../../gcc/gcc/cp/init.c:4177
0x84872d cp_gimplify_expr(tree_node**, gimple**, gimple**)
        ../../gcc/gcc/cp/cp-gimplify.c:592
0xaf51b2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gcc/gimplify.c:10210
0xafa7b6 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gcc/gimplify.c:5699
0xaf72b6 gimplify_cleanup_point_expr
        ../../gcc/gcc/gimplify.c:5475
0xaf72b6 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gcc/gimplify.c:10666
0xafa7b6 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gcc/gimplify.c:5699
0xafca85 gimplify_bind_expr
        ../../gcc/gcc/gimplify.c:1154
0xaf71d8 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc/gcc/gimplify.c:10500
0xafa7b6 gimplify_stmt(tree_node**, gimple**)
        ../../gcc/gcc/gimplify.c:5699
0xafd6b9 gimplify_body(tree_node*, bool)
        ../../gcc/gcc/gimplify.c:11480
0xafdd46 gimplify_function_tree(tree_node*)
        ../../gcc/gcc/gimplify.c:11636
0x978a97 cgraph_node::analyze()
        ../../gcc/gcc/cgraphunit.c:625
0x97be23 analyze_functions
        ../../gcc/gcc/cgraphunit.c:1086
0x97cb08 symbol_table::finalize_compilation_unit()
        ../../gcc/gcc/cgraphunit.c:2543

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