From patchwork Tue Sep 13 12:48:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 669327 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3sYPcx2bLFz9sRZ for ; Tue, 13 Sep 2016 22:49:04 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=FJxOvgH1; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; q=dns; s=default; b=J7ZzLAQ7ruWYIgI +Hvq0gVwdYHEVTLfl4mkEz6J4qXSt8gDjoAK+/LQzA1XnIaYt4ieJaTEobn0cw8n nZntDwQhrJlwfEqqa3AjfNyBdvEtSZD9kD9E47sco6OABrqfzRukGWJUq5F4//sQ InF6awtOzzrBR82FbrHYMhnW/M64= 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 :mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; s=default; bh=PZgjYt4WtiTtI73QOpAg8 WL+sGc=; b=FJxOvgH1cS0TbK4NbZPp0eN0l52M/ohiJCwLrrHhJZdKZ+OFcikTL iOByilKBOYBauxT+aZVipNHoss2CUiBDwlUOhlwD0IqxlPD+biaPc5xenLp4sLbn t+ZyL0VpzFlRSPossLpz6CXBW7r8MsJ/MgYrE+o+8NQqN1XuP4OLK0= Received: (qmail 2982 invoked by alias); 13 Sep 2016 12:48:43 -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 2951 invoked by uid 89); 13 Sep 2016 12:48:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.2 spammy=unfortunatly X-HELO: mail-oi0-f44.google.com Received: from mail-oi0-f44.google.com (HELO mail-oi0-f44.google.com) (209.85.218.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 13 Sep 2016 12:48:31 +0000 Received: by mail-oi0-f44.google.com with SMTP id w11so8149498oia.2 for ; Tue, 13 Sep 2016 05:48:31 -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=pnQlJcqZljCyHjBCAq+Lhr2kIVQd9jVZsTRzMZHHpg0=; b=dciyCLvnesFzPnMyEheXRo7OrcQoRar8VQQuLFqLEjrwwtVwPojV9c/ZlwYKeJGC6A CIlzQPPzlMuNObLZ6NSGTkyFZJsa3QMpdOImdVz9shNkHJRNDaSM23jw3EicN4hfhIxI jmkLlkvzHsYJs7+w7WJ65KrnOYSvZESZxwu00tFFmB+sj1ZlKHJ0D8EPrlNSaewvVkIP 9sX7vYV4Hc+iKyaxtZf5VRPcaLFc4FXElBeH2yZUIhz6cDXgNIQPiVFW67humLcYSdGu 3WRaASrGvrmk9HPmLzlXgigFHxcTf38NzxDOBw3DsNz9d4gIPlTk8nMMmKBjdhunNQCh /5Tg== X-Gm-Message-State: AE9vXwNIdR1PWLLsGnLIerYS32s8ZmIDVr1hbCNYZVA6MgHVIUKlxgWNAT4UYiruDdi+XLduvZDCp5KvVbOeqNMy X-Received: by 10.157.10.110 with SMTP id 101mr29306095otg.123.1473770909950; Tue, 13 Sep 2016 05:48:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.105.169 with HTTP; Tue, 13 Sep 2016 05:48:09 -0700 (PDT) In-Reply-To: References: <20160908110641.GB23306@redhat.com> <87oa3vwrkf.fsf@linux-m68k.org> From: Jason Merrill Date: Tue, 13 Sep 2016 08:48:09 -0400 Message-ID: Subject: Re: RFA (libstdc++): PATCH to implement C++17 over-aligned new To: Andreas Schwab Cc: Jonathan Wakely , libstdc++@gcc.gnu.org, gcc-patches List X-IsSubscribed: yes Does this help? On Tue, Sep 13, 2016 at 8:32 AM, Andreas Schwab wrote: > On Sep 12 2016, Jason Merrill wrote: > >> I'm checking in this patch, which should fix the remaining issues: > > Unfortunatly that breaks a few other tests: > > FAIL: g++.dg/cpp0x/alignas5.C -std=c++11 (test for excess errors) > FAIL: g++.dg/cpp0x/alignas5.C -std=c++14 (test for excess errors) > 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) > 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) > FAIL: g++.dg/cpp0x/gen-attrs-54.C -std=c++11 (test for excess errors) > FAIL: g++.dg/cpp0x/gen-attrs-54.C -std=c++14 (test for excess errors) > FAIL: g++.dg/ipa/devirt-33.C (test for excess errors) > 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) > FAIL: g++.dg/pr67989.C (test for excess errors) > > They all fail with "warning: requested alignment %d is larger than 2 > [-Wattributes]". > > Andreas. > > -- > Andreas Schwab, schwab@linux-m68k.org > GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 > "And now for something completely different." commit 113f925a58a37cb8f18cd9c7aeeb4c03f5fc6afe Author: Jason Merrill Date: Tue Sep 13 08:46:06 2016 -0400 * c-common.c (check_cxx_fundamental_alignment_constraints): Use unsigned HOST_WIDE_INT. diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 9b5e016..e3dc0f5 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -7861,8 +7861,9 @@ check_cxx_fundamental_alignment_constraints (tree node, int flags) { bool alignment_too_large_p = false; - unsigned requested_alignment = (1U << align_log) * BITS_PER_UNIT; - unsigned max_align = 0; + unsigned HOST_WIDE_INT requested_alignment + = (unsigned HOST_WIDE_INT)BITS_PER_UNIT << align_log; + unsigned HOST_WIDE_INT max_align = 0; if ((!(flags & ATTR_FLAG_CXX11) && !warn_cxx_compat) || (node == NULL_TREE || node == error_mark_node)) @@ -7910,14 +7911,15 @@ check_cxx_fundamental_alignment_constraints (tree node, largest alignment the object file can represent, but a type that is only allocated dynamically could request even larger alignment. So only limit type alignment to what TYPE_ALIGN can represent. */ - if (requested_alignment > (max_align = 8U << 28)) + if (requested_alignment > (max_align = (unsigned HOST_WIDE_INT)8 << 28)) alignment_too_large_p = true; } if (alignment_too_large_p) pedwarn (input_location, OPT_Wattributes, "requested alignment %d is larger than %d", - requested_alignment / BITS_PER_UNIT, max_align / BITS_PER_UNIT); + int(requested_alignment / BITS_PER_UNIT), + int(max_align / BITS_PER_UNIT)); return !alignment_too_large_p; }