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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=77691

--- Comment #35 from Jonathan Wakely <redi at gcc dot gnu.org> ---
That said, this would probably fix it:

--- a/libstdc++-v3/libsupc++/new_op.cc
+++ b/libstdc++-v3/libsupc++/new_op.cc
@@ -41,6 +41,11 @@ extern "C" void *malloc (std::size_t);
 _GLIBCXX_WEAK_DEFINITION void *
 operator new (std::size_t sz) _GLIBCXX_THROW (std::bad_alloc)
 {
+#if defined __sun && defined __i386__
+  if (sz >= 16)
+    return ::operator new(sz, std::align_val_t(16));
+#endif
+
   void *p;

   /* malloc (0) is unpredictable; avoid it.  */



As noted in PR 77691, there are other targets where GCC's max_align_t does not
match the target malloc. That includes vxworks and mingw*.

Reply via email to