From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 57501 invoked by alias); 11 Oct 2016 20:12:05 -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 57491 invoked by uid 89); 11 Oct 2016 20:12:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.2 spammy=Hx-languages-length:1095, pretending, Hx-spam-relays-external:209.85.218.45, H*RU:209.85.218.45 X-HELO: mail-oi0-f45.google.com Received: from mail-oi0-f45.google.com (HELO mail-oi0-f45.google.com) (209.85.218.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Oct 2016 20:12:03 +0000 Received: by mail-oi0-f45.google.com with SMTP id d132so37384359oib.2 for ; Tue, 11 Oct 2016 13:12:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=q0/2dOEt5lTt59Ot7JmrsROG74aeKGL0UIXF3q1YfaM=; b=AcyUHPcC1YSHMv8kHYKiLRDArzySNx3jPZLIiuh7RRLYXnjvPnssKC3RxU4hCamvn4 gw0TjgTACyep3MlRss1ZpVr/fjkSqgj7RyDFEGP2OHNGyHkdFhXFLKKzqCLwqsPGiApd L+iytB5kMZl84oSeBNPQa/n+uXBDTZrW6fespxlGK2TdC5zVzOV3hdXlq7QbcuuErAdt cmv2XGllw+R3GRDGUUt45he3QWfiood0588c5zkAT2XPmOJ+gfbUMyZbk9ckXZ4H6UHD no2eX62ppDZbU+CzmHYmIx3eUXhAK0VF2p6LTL4Aw3HY1kOBJThzJ79c/5b7GDtcTisQ zt1w== X-Gm-Message-State: AA6/9RmPo7LamWS1jknTrNHpq5Yv5LiPS/wwJVlLrzSzkDOIvkC05pUxzULye02Yl6UmjleIoLDGAnYtNTZTp6EF X-Received: by 10.157.40.174 with SMTP id s43mr3226210ota.36.1476216722096; Tue, 11 Oct 2016 13:12:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.87.231 with HTTP; Tue, 11 Oct 2016 13:11:41 -0700 (PDT) In-Reply-To: References: From: Jason Merrill Date: Tue, 11 Oct 2016 20:12:00 -0000 Message-ID: Subject: Re: [PATCH] Implement new hook for max_align_t_align To: DJ Delorie Cc: John David Anglin , Bernd Edlinger , gcc-patches List , Jeff Law Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00779.txt.bz2 On Tue, Oct 11, 2016 at 2:59 PM, DJ Delorie wrote: > > Jason Merrill writes: >> If PA malloc doesn't actually provide 16-byte alignment, this change >> seems problematic; it will mean any type that wants 16-byte alignment >> will silently get 8-byte alignment instead. > > Should such cases be calling memalign (or posix_memalign) instead of > malloc? We're talking about this in the context of C++17 aligned new, which uses one of those functions (or C aligned_alloc) under the hood. Currently on PA, allocating one of these types with 'new' in C++14 mode gives a warning because the compiler doesn't think the allocation will actually provide the 16-byte alignment that the type wants. This warning seems to be correct. This patch would silence that warning by pretending that malloc will provide 16-byte alignment, which is not actually true. It seems to me that the warning is correct, but not a problem in this case, so perhaps turning the warning off by default on PA is the right solution. Jason