From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60691 invoked by alias); 14 Sep 2016 11:53:26 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 60672 invoked by uid 89); 14 Sep 2016 11:53:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=vol, rfa, UD:new_opa.cc, Wattributes X-Spam-User: qpsmtpd, 2 recipients X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 14 Sep 2016 11:53:16 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 8DD58C9; Wed, 14 Sep 2016 13:53:13 +0200 (CEST) Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Eb3ZyDSZ+JRy; Wed, 14 Sep 2016 13:53:10 +0200 (CEST) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.110]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id AD225C8; Wed, 14 Sep 2016 13:53:10 +0200 (CEST) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.15.2+Sun/8.15.2/Submit) id u8EBrAhN003164; Wed, 14 Sep 2016 13:53:10 +0200 (MEST) From: Rainer Orth To: Jonathan Wakely Cc: Jason Merrill , libstdc++@gcc.gnu.org, gcc-patches List Subject: Re: RFA (libstdc++): PATCH to implement C++17 over-aligned new References: <20160908110641.GB23306@redhat.com> <20160912161014.GC17165@redhat.com> Date: Wed, 14 Sep 2016 12:11:00 -0000 In-Reply-To: <20160912161014.GC17165@redhat.com> (Jonathan Wakely's message of "Mon, 12 Sep 2016 17:10:15 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (usg-unix-v) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2016-09/txt/msg00806.txt.bz2 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=, >> tinfo=0xffff80ff1d2d0c98 , >> dest=0xffff80ff1d1028f0 ) >> 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 must be aligned to at least its size Thanks. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University