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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
          Component|c++                         |tree-optimization
            Summary|Segmentation fault in       |5/6 Regression]
                   |fold_builtin_alloca_with_al |Segmentation fault in
                   |ign in tree-ssa-ccp.c       |fold_builtin_alloca_with_al
                   |                            |ign in tree-ssa-ccp.c
           Severity|major                       |normal

--- Comment #6 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
trippels@gcc75 ~ % cat mallocdst16.ii
namespace std {
typedef long unsigned size_t;
struct nothrow_t;
}
namespace vespamalloc {
void fn1(void *);
template <typename> class A {
public:
  static unsigned long fillStack(unsigned long);
};
template <typename StackRep>
unsigned long A<StackRep>::fillStack(unsigned long p1) {
  void *retAddr[p1];
  fn1(retAddr);
}
class B {
protected:
  B(void *);
};
template <int StackTraceLen> class D : B {
public:
  D() : B(0) {}
  void alloc(int) { A<int>::fillStack(StackTraceLen); }
};
template <typename, typename> class C {
public:
  void *malloc(unsigned long);
};
template <typename MemBlockPtrT, typename ThreadListT>
void *C<MemBlockPtrT, ThreadListT>::malloc(unsigned long) {
  MemBlockPtrT mem;
  mem.alloc(0);
}
C<D<16>, int> *_GmemP;
}
void *operator new(std::size_t, std::nothrow_t &) noexcept {
  return vespamalloc::_GmemP->malloc(0);
}
void *operator new[](std::size_t, std::nothrow_t &) noexcept {
  return vespamalloc::_GmemP->malloc(0);
}

trippels@gcc75 ~ % g++ -std=c++14 -O3 -c mallocdst16.ii
mallocdst16.ii: In function ?void* operator new(std::size_t, std::nothrow_t&)?:
mallocdst16.ii:36:7: internal compiler error: Segmentation fault

Reply via email to