diff --git a/gcc/alloc-pool.h b/gcc/alloc-pool.h index 1785df5..4b4bc56 100644 --- a/gcc/alloc-pool.h +++ b/gcc/alloc-pool.h @@ -413,7 +413,8 @@ pool_allocator::allocate () VALGRIND_DISCARD (VALGRIND_MAKE_MEM_UNDEFINED (header, size)); /* Call default constructor. */ - return (T *)(header); + char *ptr = (char *) header; + return new (ptr) T (); } /* Puts PTR back on POOL's free list. */ diff --git a/gcc/cselib.h b/gcc/cselib.h index cdd06ad..a0da27f 100644 --- a/gcc/cselib.h +++ b/gcc/cselib.h @@ -42,6 +42,9 @@ struct cselib_val struct cselib_val *next_containing_mem; + /* Default constructor. */ + cselib_val () {} + /* Pool allocation new operator. */ inline void *operator new (size_t) { @@ -67,6 +70,9 @@ struct elt_loc_list { /* The insn that made the equivalence. */ rtx_insn *setting_insn; + /* Default constructor. */ + elt_loc_list () {} + /* Pool allocation new operator. */ inline void *operator new (size_t) {