From patchwork Sat Nov 17 11:06:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 999287 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-490362-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gdcproject.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="MnOhWcW1"; 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 42xsjc0nr3z9s9h for ; Sat, 17 Nov 2018 22:06:26 +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 :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=xaBuEMxnVg2V5tJrMneimzoDVK7w/l4cwkgNg36OkceM4C R5QXyDye2s9N1wM5yvjAJNVf7qDBJw8r0aAiubRuKbW5RcFk3cd79Gl33TQ3drJK dcn/RFvuwxiFgyygLK2/Ec+iqxqdIVzXjT0Z2phbt4MkPeNveC6V6U2tduxPc= 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:from:date:message-id:subject:to:content-type; s= default; bh=IKJmNoXmTckZ1kWjaCpcLZQJSWY=; b=MnOhWcW178JnabUASC/Q e2L/DVBiSyFodzZPD/c/XFbXkbbGwZERfMquzddHZRm4CuLd04zBL468FBtldkzD xtgXD7wyNIt78TN5395C0yyY+Nrvtu0u9yCiJImjrpJbaGWp44D9TEQgDvQxwXZ0 q1ZWLi0uuVpsxgyxNTgg80g= Received: (qmail 4034 invoked by alias); 17 Nov 2018 11:06:19 -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 4022 invoked by uid 89); 17 Nov 2018 11:06:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=mno-sse, mnosse, Hx-languages-length:1140, HX-Received:Sat X-HELO: mail-qk1-f174.google.com Received: from mail-qk1-f174.google.com (HELO mail-qk1-f174.google.com) (209.85.222.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 17 Nov 2018 11:06:17 +0000 Received: by mail-qk1-f174.google.com with SMTP id o125so41592964qkf.3 for ; Sat, 17 Nov 2018 03:06:17 -0800 (PST) MIME-Version: 1.0 From: Iain Buclaw Date: Sat, 17 Nov 2018 12:06:03 +0100 Message-ID: Subject: [PATCH, PR d/87824] Committed return min_align_of_type from alignsize hook. To: gcc-patches X-IsSubscribed: yes Hi, This patch addresses some of the failing tests on x86_64-linux/-m32. The failing tests in question checked that data with 'long' was sufficiently aligned. assert((&var.longfield % long.alignof) == 0); Where long.alignof was replaced with the result of TYPE_ALIGN_UNIT. The D language expects the minimum alignment from .alignof, so on -m32 alignof should return 4 instead of 8. Bootstrapped and ran D2 testsuite on x86_64-linux-gnu with {-m64,-m32/-mno-sse/-mno-mmx,-mx32} runtest flags. Committed to trunk as r266234. --- gcc/d/ChangeLog: 2018-11-17 Iain Buclaw PR d/87824 * d-target.cc (Target::alignsize): Return min_align_of_type. diff --git a/gcc/d/d-target.cc b/gcc/d/d-target.cc index 3ae791b5f70..86b042938af 100644 --- a/gcc/d/d-target.cc +++ b/gcc/d/d-target.cc @@ -189,7 +189,7 @@ unsigned Target::alignsize (Type *type) { gcc_assert (type->isTypeBasic ()); - return TYPE_ALIGN_UNIT (build_ctype (type)); + return min_align_of_type (build_ctype (type)); } /* Return GCC field alignment size for type TYPE. */