public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: Jason Merrill <jason@redhat.com>
Cc: Jonathan Wakely <jwakely@redhat.com>,
	libstdc++@gcc.gnu.org,
	       gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: Re: RFA (libstdc++): PATCH to implement C++17 over-aligned new
Date: Mon, 12 Sep 2016 14:15:00 -0000	[thread overview]
Message-ID: <yddlgyxw6hq.fsf@CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <CADzB+2mMHsrPdL5u2NWb_wqwvNcTo-nOKLaJ-Nft6+Myo=++Ug@mail.gmail.com>	(Jason Merrill's message of "Fri, 9 Sep 2016 17:20:42 -0400")

Jason Merrill <jason@redhat.com> writes:

> On Thu, Sep 8, 2016 at 7:06 AM, Jonathan Wakely <jwakely@redhat.com> wrote:
>> On 08/09/16 09:10 +0200, Marc Glisse wrote:
>>>
>>> Do we want a generic fallback implementation (similar to
>>> gcc/config/i386/gmm_malloc.h)? A windows version with _aligned_malloc /
>>> _aligned_free would also be possible.
>>
>> Making it work for MinGW would be nice.
>
> OK, this is what I'm checking in; could someone test it on MinGW?

The new tests are failing in various ways on Solaris:

* 32-bit:

+FAIL: g++.dg/cpp1z/aligned-new1.C   (test for excess errors)
+WARNING: g++.dg/cpp1z/aligned-new1.C   compilation failed to produce executable
+FAIL: g++.dg/cpp1z/aligned-new2.C   (test for excess errors)
+WARNING: g++.dg/cpp1z/aligned-new2.C   compilation failed to produce executable
+FAIL: g++.dg/cpp1z/aligned-new3.C   (test for excess errors)
+WARNING: g++.dg/cpp1z/aligned-new3.C   compilation failed to produce executable
+FAIL: g++.dg/cpp1z/aligned-new5.C  -std=gnu++11 (test for excess errors)
+WARNING: g++.dg/cpp1z/aligned-new5.C  -std=gnu++11 compilation failed to produc
e executable
+FAIL: g++.dg/cpp1z/aligned-new5.C  -std=gnu++14 (test for excess errors)
+WARNING: g++.dg/cpp1z/aligned-new5.C  -std=gnu++14 compilation failed to produc
e executable
+FAIL: g++.dg/cpp1z/aligned-new5.C  -std=gnu++98 (test for excess errors)
+WARNING: g++.dg/cpp1z/aligned-new5.C  -std=gnu++98 compilation failed to produc
e executable

  All instances of

Excess errors:
Undefined                       first referenced
 symbol                             in file
operator new(unsigned int, std::align_val_t) /var/tmp//cc_0Nrkd.o
ld: fatal: symbol referencing errors

  libsupc++/new_opa.o contains

  _ZnwjSt11align_val_t (operator new(unsigned int, std::align_val_t))

  while for 64-bit there is

  _ZnwmSt11align_val_t (operator new(unsigned long, std::align_val_t))

  The former isn't matched by config/abi/pre/gnu.ver

    # C++17 aligned new/delete
    _ZnwmSt11align_val_t;
    _ZnwmSt11align_val_tRKSt9nothrow_t;
    _ZnamSt11align_val_t;
    _ZnamSt11align_val_tRKSt9nothrow_t;

  I strongly suspects this needs to be

  _Znw[jmy]* just as for regular new/delete.

* For 64-bit, I get

+FAIL: g++.dg/cpp1z/aligned-new5.C  -std=gnu++11 execution test
+FAIL: g++.dg/cpp1z/aligned-new5.C  -std=gnu++14 execution test
+FAIL: g++.dg/cpp1z/aligned-new5.C  -std=gnu++98 execution test

  which fails like this:

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

  gdb shows

#7  0xffff80ff1d104bdc in __cxxabiv1::__cxa_throw (obj=<optimized out>, 
    tinfo=0xffff80ff1d2d0c98 <typeinfo for std::bad_alloc>, 
    dest=0xffff80ff1d1028f0 <std::bad_alloc::~bad_alloc()>)
    at /vol/gcc/src/hg/trunk/local/libstdc++-v3/libsupc++/eh_throw.cc:96
#8  0xffff80ff1d10604c in operator new (sz=4, al=(unknown: 64))
    at /vol/gcc/src/hg/trunk/local/libstdc++-v3/libsupc++/new_opa.cc:71
#9  0x00000000004010df in main ()
    at /vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/cpp1z/aligned-new5.C:11

  and aligned_alloc(3C) documents

       The  value of alignment must be a valid alignment supported by the sys-
       tem, that is, any power of two (1, 2, 4, 8, ...), and the value of size
       must be an integral multiple of alignment.

  which isn't the case here.

  Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

  parent reply	other threads:[~2016-09-12 14:14 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-08  7:10 Jason Merrill
2016-09-08  8:32 ` Marc Glisse
2016-09-08 11:18   ` Jonathan Wakely
2016-09-09 21:40     ` Jason Merrill
2016-09-10  7:03       ` Christophe Lyon
2016-09-10 10:14         ` Marc Glisse
2016-09-10 10:35           ` Jonathan Wakely
2016-09-11  9:14         ` Christophe Lyon
2016-09-11  9:55           ` Jonathan Wakely
2016-09-11  9:56             ` Jonathan Wakely
2016-09-11 10:20             ` Christophe Lyon
2016-09-11 12:09               ` Jonathan Wakely
2016-09-13 13:04         ` Szabolcs Nagy
2016-09-10 10:14       ` Jonathan Wakely
2016-09-11  7:09       ` Andreas Schwab
2016-09-12 21:13         ` Jason Merrill
2016-09-13  8:41           ` Christophe Lyon
2016-09-13 12:37           ` Andreas Schwab
2016-09-13 12:54             ` Jason Merrill
2016-09-13 13:18               ` Andreas Schwab
2016-09-13 13:21                 ` Jason Merrill
2016-09-14 12:13                   ` Andreas Schwab
2016-09-14 16:11                     ` Christophe Lyon
2016-09-14 16:37                       ` Jason Merrill
2016-09-15 10:00                         ` Rainer Orth
2016-09-15 12:23                           ` Christophe Lyon
2016-09-15 20:09                             ` Jason Merrill
2016-09-16  7:12                               ` Rainer Orth
2016-09-16  8:15                                 ` Christophe Lyon
2016-09-16  9:14                                 ` Jonathan Wakely
2016-09-16  9:51                                   ` Marc Glisse
2016-09-16 11:12                                     ` Jonathan Wakely
2016-09-16 13:13                                       ` Jonathan Wakely
2016-09-16 13:17                                         ` Rainer Orth
2016-09-16 18:19                                         ` Jonathan Wakely
2016-09-12 14:15       ` Rainer Orth [this message]
2016-09-12 16:19         ` Jonathan Wakely
2016-09-12 18:57           ` Jason Merrill
2016-09-14 12:11           ` Rainer Orth
2016-09-08 11:00 ` Jonathan Wakely
2017-11-24 14:26 ` Marc Glisse
2017-11-29 21:23   ` Jason Merrill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yddlgyxw6hq.fsf@CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).