public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: Jason Merrill <jason@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: Wed, 14 Sep 2016 12:11:00 -0000	[thread overview]
Message-ID: <yddmvja4s0p.fsf@CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <20160912161014.GC17165@redhat.com> (Jonathan Wakely's message of	"Mon, 12 Sep 2016 17:10:15 +0100")

Hi Jonathan,

>>* 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.
>
> Ah, it seems GNU's aligned_alloc doesn't check that requirement. So we
> need to increase the requested size, maybe something like this patch.

I've now tested this patch on top of r240127 and the execution failures
are gone indeed.

The only failures now remaining are (on 32-bit sparc-sun-solaris2.12,
both 64-bit sparc and 32/64-bit i386-pc-solaris2.12 are fine)

FAIL: g++.dg/cpp0x/gen-attrs-21.C  -std=c++11 (test for excess errors)
FAIL: g++.dg/cpp0x/gen-attrs-21.C  -std=c++14 (test for excess errors)

Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/cpp0x/gen-attrs-21.C:9:31: error: requested alignment 16 is larger than 8 [-Wattributes]
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/cpp0x/gen-attrs-21.C:15:32: error: requested alignment 16 is larger than 8 [-Wattributes]
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/cpp0x/gen-attrs-21.C:21:1: error: static assertion failed: sizeof (S) == 8 + 16 + 8

FAIL: g++.dg/cpp0x/gen-attrs-51.C  -std=c++11 (test for excess errors)
FAIL: g++.dg/cpp0x/gen-attrs-51.C  -std=c++14 (test for excess errors)

Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/cpp0x/gen-attrs-51.C:6:44: error: requested alignment 16 is larger than 8 [-Wattributes]
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/cpp0x/gen-attrs-51.C:9:1: error: static assertion failed: Alignment should be 16

FAIL: g++.dg/ipa/devirt-33.C   (test for excess errors)

Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/ipa/devirt-33.C:46:32: warning: requested alignment 16 is larger than 8 [-Wattributes]

FAIL: g++.dg/lookup/name-clash11.C  -std=gnu++11 (test for excess errors)
FAIL: g++.dg/lookup/name-clash11.C  -std=gnu++14 (test for excess errors)

Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/lookup/name-clash11.C:51:11: warning: requested alignment 16 is larger than 8 [-Wattributes]
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/lookup/name-clash11.C:7:21: error: static assertion failed: __alignof__ (this->A) == 16

FAIL: 29_atomics/atomic/65147.cc (test for excess errors)

Excess errors:
/vol/gcc/src/hg/trunk/local/libstdc++-v3/testsuite/29_atomics/atomic/65147.cc:26: error: static assertion failed: atomic<S16> must be aligned to at least its size

Thanks.
	Rainer

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

  parent reply	other threads:[~2016-09-14 11:53 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
2016-09-12 16:19         ` Jonathan Wakely
2016-09-12 18:57           ` Jason Merrill
2016-09-14 12:11           ` Rainer Orth [this message]
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=yddmvja4s0p.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).