From patchwork Sun Mar 31 14:35:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 1071702 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-498667-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="P3gcQNKy"; 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 44XJ1y5KxZz9sQm for ; Mon, 1 Apr 2019 01:36:16 +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=JwLtU7+0oE5axrAgaNLZjnDiAYoU4GnPQulDNlHYXyJ5Gm o4NcaNsy74my79eQDW78BTSKgU0lLAdbSr4n7ZoS18+tOzKHVVVhEyFD6ZBb2UoC b9CZ7UztmxDUaPcHKUKkn4ithp4dyfS9Hcy5ysAVvPSLnicOTepk6KjKiedFI= 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=6p1egwn8mJzxEghJf9SnMd20/3A=; b=P3gcQNKy31VZvsAhU3Nk HNfMkzUywxO06Izft0KjjOru/ZM6f9czf0JWaEqUbMQtnX3cnCCBRet5QOh6nDWR sQzAnGr6barP1FWJwlgrSyJsWKrSSEgxmmG5G4htUH7a9LaHGOaDHdCQMmfep/Gt pkN/5PEeh14lwk0Pq/JqZYw= Received: (qmail 72823 invoked by alias); 31 Mar 2019 14:36:05 -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 72571 invoked by uid 89); 31 Mar 2019 14:36:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.8 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, URIBL_BLOCKED autolearn=ham version=3.3.1 spammy= X-HELO: mail-qt1-f178.google.com Received: from mail-qt1-f178.google.com (HELO mail-qt1-f178.google.com) (209.85.160.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 31 Mar 2019 14:36:03 +0000 Received: by mail-qt1-f178.google.com with SMTP id v32so7654937qtc.10 for ; Sun, 31 Mar 2019 07:36:03 -0700 (PDT) MIME-Version: 1.0 From: Iain Buclaw Date: Sun, 31 Mar 2019 16:35:49 +0200 Message-ID: Subject: [PATCH PR d/88462] Committed fix for run-time SIGSEGV in ModuleInfo.flags() To: gcc-patches X-IsSubscribed: yes Hi, Patch fixes problems accessing ModuleInfo on SPARC. The current forced alignment is not at all necessary. Bootstrapped and regression tested on x86_64-linux-gnu. Committed to trunk as r270043. diff --git a/gcc/d/modules.cc b/gcc/d/modules.cc index a1fc534c3b6..e9bd44115f9 100644 --- a/gcc/d/modules.cc +++ b/gcc/d/modules.cc @@ -534,7 +534,9 @@ layout_moduleinfo_fields (Module *decl, tree type) layout_moduleinfo_field (make_array_type (Type::tchar, namelen), type, offset); - finish_aggregate_type (offset, 1, type, NULL); + size_t alignsize = MAX (TYPE_ALIGN_UNIT (type), + TYPE_ALIGN_UNIT (ptr_type_node)); + finish_aggregate_type (offset, alignsize, type, NULL); return type; }