From patchwork Fri Oct 18 11:27:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1179322 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-511280-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="nWfkdfyg"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46vkKJ1Mlcz9sNx for ; Fri, 18 Oct 2019 22:27:31 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=v4zXAay6iqqdKWq/pGa+TFIhcBvuimfZLuJltDjxbmgP+v6kCxmT3 pgSikHU3dw5kzLUSXnCl4mCzjhNUbi5e96mrHFpIMMl0Nc8Yb+0UzBCVXxqNWz9G H2J12L7KZKzUJCGswY0m77DDDar+qF2E5+IyYtc04V9E4FJ3L7HCt4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=gQFK3J1yR/0cQ5KC/ukgH87XR1I=; b=nWfkdfygzIrN/e3f8JdX z+0LBTp1NF4gM+3sh8ESEa6jPy5ybpN4/3AgukgpmrWZgV32IsYbH3y2wUrVn/Rc Eh9+B30WYp63ckRP1LnIvPsgunoVtlrXbZgU5W0T+xEw1eVA70bHgXKY42ZSaMAU mpBLUEtQ5aT1rN1Udb7f844= Received: (qmail 22449 invoked by alias); 18 Oct 2019 11:27:25 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 22430 invoked by uid 89); 18 Oct 2019 11:27:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 18 Oct 2019 11:27:23 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B97063077B40; Fri, 18 Oct 2019 11:27:22 +0000 (UTC) Received: from localhost (unknown [10.33.36.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id 63FAF600C8; Fri, 18 Oct 2019 11:27:22 +0000 (UTC) Date: Fri, 18 Oct 2019 12:27:21 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] PR libstdc++/92143 adjust for OS X aligned_alloc behaviour Message-ID: <20191018112721.GA21462@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.12.1 (2019-06-15) OS X 10.15 adds aligned_alloc but it has the same restriction as the AIX version, namely that alignments smaller than sizeof(void*) are not supported. PR libstdc++/92143 * libsupc++/new_opa.cc (operator new) [__APPLE__]: Increase alignment to at least sizeof(void*). Tested powerpc64le-linux, committed to trunk. commit 356a59f69de9896d5b517cb28790da4335fd758f Author: Jonathan Wakely Date: Fri Oct 18 11:45:20 2019 +0100 PR libstdc++/92143 adjust for OS X aligned_alloc behaviour OS X 10.15 adds aligned_alloc but it has the same restriction as the AIX version, namely that alignments smaller than sizeof(void*) are not supported. PR libstdc++/92143 * libsupc++/new_opa.cc (operator new) [__APPLE__]: Increase alignment to at least sizeof(void*). diff --git a/libstdc++-v3/libsupc++/new_opa.cc b/libstdc++-v3/libsupc++/new_opa.cc index aa5d2e14455..80eb343a1c8 100644 --- a/libstdc++-v3/libsupc++/new_opa.cc +++ b/libstdc++-v3/libsupc++/new_opa.cc @@ -108,9 +108,10 @@ operator new (std::size_t sz, std::align_val_t al) sz = 1; #if _GLIBCXX_HAVE_ALIGNED_ALLOC -# ifdef _AIX +# if defined _AIX || defined __APPLE__ /* AIX 7.2.0.0 aligned_alloc incorrectly has posix_memalign's requirement - * that alignment is a multiple of sizeof(void*). */ + * that alignment is a multiple of sizeof(void*). + * OS X 10.15 has the same requirement. */ if (align < sizeof(void*)) align = sizeof(void*); # endif