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

            Bug ID: 94245
           Summary: [10 Regression] ICE in ipa_find_agg_cst_for_param, at
                    ipa-prop.c:3467 since r10-7237-g4e3d3e40726e1b68
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: marxin at gcc dot gnu.org, rguenth at gcc dot gnu.org
  Target Milestone: ---

I hope it's the last fallout:

$ cat x.ii
template < typename, typename, typename, typename, typename = int >
class _Rb_tree {
  typedef int *_Link_type;
  struct _Alloc_node {
    _Alloc_node(_Rb_tree &__t) : _M_t(__t) {}
    template < typename _Arg > _Link_type operator()(_Arg) {
      _M_t._M_create_node(0);
    }
    _Rb_tree &_M_t;
  };
  template < typename _Args > void _M_create_node(_Args);
  template < typename _NodeGen > void _M_clone_node(int, _NodeGen &__node_gen)
{
    int *__trans_tmp_1 = __node_gen(__trans_tmp_1);
  }
  template < typename _NodeGen > _Link_type _M_copy(int, int, _NodeGen &);
  template < typename _NodeGen > void _M_copy(_Rb_tree, _NodeGen __gen) {
    _M_copy(0, 0, __gen);
  }
  void _M_copy(_Rb_tree __x) {
    _Alloc_node __an(*this);
    _M_copy(__x, __an);
  }

public:
  _Rb_tree(const _Rb_tree &__x) { _M_copy(__x); }
};
template < typename _Key, typename _Val, typename _KoV, typename _Compare,
           typename _Alloc >
template < typename _NodeGen >
typename _Rb_tree< _Key, _Val, _KoV, _Compare, _Alloc >::_Link_type
_Rb_tree< _Key, _Val, _KoV, _Compare, _Alloc >::_M_copy(int __x, int,
                                                        _NodeGen &__node_gen) {
  _M_clone_node(__x, __node_gen);
}
class map {
  _Rb_tree< int, int, int, int > _M_t;
};
class Trans_NS___cxx11_basic_string;
template < typename V > class static_map {
  map _m;

public:
  static_map(Trans_NS___cxx11_basic_string, V);
  operator map() { return _m; }
};
class Trans_NS___cxx11_basic_string {
public:
  Trans_NS___cxx11_basic_string(char *);
};
int handle_volume_rcp_update(int, int &, int &);
map dispatch =
    static_map< int(int, int &, int &) >("", handle_volume_rcp_update);

$ g++ x.ii -O2 -flto -fPIC -shared
x.ii: In member function ‘int* _Rb_tree< <template-parameter-1-1>,
<template-parameter-1-2>, <template-parameter-1-3>, <template-parameter-1-4>,
<template-parameter-1-5> >::_Alloc_node::operator()(_Arg)’:
x.ii:8:5: warning: no return statement in function returning non-void
[-Wreturn-type]
    8 |     }
      |     ^
x.ii: In member function ‘int* _Rb_tree< <template-parameter-1-1>,
<template-parameter-1-2>, <template-parameter-1-3>, <template-parameter-1-4>,
<template-parameter-1-5> >::_M_copy(int, int, _NodeGen&)’:
x.ii:34:1: warning: no return statement in function returning non-void
[-Wreturn-type]
   34 | }
      | ^
x.ii: At global scope:
x.ii:52:42: warning: ISO C++ forbids converting a string constant to ‘char*’
[-Wwrite-strings]
   52 |     static_map< int(int, int &, int &) >("", handle_volume_rcp_update);
      |                                          ^~
during IPA pass: cp
lto1: internal compiler error: in ipa_find_agg_cst_for_param, at
ipa-prop.c:3467
0x6584b9 ipa_find_agg_cst_for_param(ipa_agg_value_set*, tree_node*, long, bool,
bool*)
        ../../gcc/ipa-prop.c:3467
0x6584b9 ipa_find_agg_cst_for_param(ipa_agg_value_set*, tree_node*, long, bool,
bool*)
        ../../gcc/ipa-prop.c:3440
0xadc8bf evaluate_conditions_for_known_args
        ../../gcc/ipa-fnsummary.c:371
0xae6369 estimate_ipcp_clone_size_and_time(cgraph_node*, vec<tree_node*,
va_heap, vl_ptr>, vec<ipa_polymorphic_call_context, va_heap, vl_ptr>,
vec<ipa_agg_value_set, va_heap, vl_ptr>, int*, sreal*, sreal*, int*)
        ../../gcc/ipa-fnsummary.c:3658
0x165e31f perform_estimation_of_a_value
        ../../gcc/ipa-cp.c:3397
0x16662a3 estimate_local_effects
        ../../gcc/ipa-cp.c:3623
0x166ffbf propagate_constants_topo
        ../../gcc/ipa-cp.c:3819
0x166ffbf ipcp_propagate_stage
        ../../gcc/ipa-cp.c:3915
0x166ffbf ipcp_driver
        ../../gcc/ipa-cp.c:5911
0x166ffbf execute
        ../../gcc/ipa-cp.c:6004

Reply via email to