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 tree-optimization/59445] [4.9 Regression] ICE in add_old_iv_candidates, at tree-ssa-loop-ivopts.c:2541


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

Markus Trippelsdorf <octoploid at yandex dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |octoploid at yandex dot com

--- Comment #9 from Markus Trippelsdorf <octoploid at yandex dot com> ---
This issue also happens when building LLVM.

Reduced:

markus@x4 llvm_build % cat test.ii
template <typename _Iterator> struct A;
template <typename _Tp> struct A<_Tp *> {
  typedef _Tp value_type;
  typedef int difference_type;
};
template <typename _Compare> struct B {};
template <typename _Compare> struct C {
  _Compare _M_comp;
  template <typename _Value, typename _Iterator>
  int operator()(_Value &p1, _Iterator p2) {
    return _M_comp(p1, *p2);
  }
};
template <typename _Compare> C<_Compare> __val_comp_iter(B<_Compare>);
template <typename _RandomAccessIterator, typename _Compare>
void __unguarded_linear_insert(_RandomAccessIterator p1, _Compare p2) {
  typename A<_RandomAccessIterator>::value_type a;
  _RandomAccessIterator b = p1;
  --b;
  while (p2(a, b)) {
    *p1 = 0;
    p1 = b;
    --b;
  }
}
template <typename _RandomAccessIterator, typename _Compare>
void __insertion_sort(_RandomAccessIterator, _Compare p2) {
  for (_RandomAccessIterator c;; ++c)
    __unguarded_linear_insert(c, __val_comp_iter(p2));
}
template <typename _RandomAccessIterator, typename _Distance, typename
_Compare>
void __chunk_insertion_sort(_RandomAccessIterator, _Distance, _Compare p3) {
  _RandomAccessIterator d;
  __insertion_sort(d, p3);
}
template <typename _RandomAccessIterator, typename _Pointer, typename _Compare>
void __merge_sort_with_buffer(_RandomAccessIterator p1, _Pointer, _Compare p3)
{
  __chunk_insertion_sort(p1, 0, p3);
}
template <typename _RandomAccessIterator, typename _Pointer, typename
_Distance,
          typename _Compare>
void __stable_sort_adaptive(_RandomAccessIterator, _Pointer, _Distance,
                            _Compare p4) {
  _RandomAccessIterator e;
  __merge_sort_with_buffer(e, 0, p4);
}
template <typename _RandomAccessIterator, typename _Compare>
void __stable_sort(_RandomAccessIterator p1, _Compare p2) {
  __stable_sort_adaptive(
      p1, 0, typename A<_RandomAccessIterator>::difference_type(), p2);
}
template <typename _RandomAccessIterator, typename _Compare>
void stable_sort(_RandomAccessIterator, _RandomAccessIterator p2, _Compare) {
  B<_Compare> f;
  __stable_sort(p2, f);
}
class D {
public:
  void m_fn1();
};
class F {
  struct G {
    D MFI;
    int operator()(int p1, int p2) {
      if (p1)
        return 0;
      if (p2)
        return 1;
      MFI.m_fn1();
    }
  };
  void m_fn1(int &p1) const;
};
void F::m_fn1(int &p1) const {
  int *g, *h;
  stable_sort(h, g, G());
}

markus@x4 llvm_build % g++ -O2 -c test.ii
test.ii: In member function âvoid F::m_fn1(int&) constâ:
test.ii:74:6: internal compiler error: in add_old_iv_candidates, at
tree-ssa-loop-ivopts.c:2541

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