From patchwork Tue Apr 23 23:13:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 1089824 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-499572-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine 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="Ip2UQeaI"; 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 44pfQm5xHWz9sNC for ; Wed, 24 Apr 2019 09:14:06 +1000 (AEST) 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=VIfZF7ikrHTRlOu5g0BnJOQANM78kDoBImSQyR2nWXdzyD dYbwRJlYTWAZdHUel6sF1Oj8bexT7LhrGxZy/Qt+FzPNYneHZFtnnNJdbFrN3UzO em2e7BSSSaosxaotLVIH/OEODSxCGen5CfINmMpDwbGgqbHlUNmR9RlUjohdg= 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=ODU3i/vOj8zSwtq4BN180JfJflM=; b=Ip2UQeaIyOsPwW9JGNAB kQu+TuRReJc6nyG3ybgIGTfMrarC2aXN6ejZMcpXdWbqVZwwDKirb7se1XP1MDO5 buOI0//iLAloxA5SvMQAttSaOa4KFUQznHz+jBAO0MSA4+NhKaWEcZlzvCiMTkkW WKpEz7zYrkPthg+oop4Rmhc= Received: (qmail 68092 invoked by alias); 23 Apr 2019 23:13:58 -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 67931 invoked by uid 89); 23 Apr 2019 23:13:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.9 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.1 spammy=noticed X-HELO: mail-qt1-f177.google.com Received: from mail-qt1-f177.google.com (HELO mail-qt1-f177.google.com) (209.85.160.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 23 Apr 2019 23:13:57 +0000 Received: by mail-qt1-f177.google.com with SMTP id 43so4088330qtc.1 for ; Tue, 23 Apr 2019 16:13:56 -0700 (PDT) MIME-Version: 1.0 From: Iain Buclaw Date: Wed, 24 Apr 2019 01:13:44 +0200 Message-ID: Subject: [PATCH, netbsd] Define TARGET_D_CRITSEC_SIZE for D language To: gcc-patches X-IsSubscribed: yes Hi, This patch adds missing implementation of TARGET_D_CRITSEC_SIZE, which would be noticed when using any bare synchronized statements. I couldn't see any target-specific alternatives of pthread_mutex_t in netbsd headers, so the condition should be right. OK for trunk? diff --git a/gcc/config/netbsd-d.c b/gcc/config/netbsd-d.c index 76342aacae3..c49366dc23b 100644 --- a/gcc/config/netbsd-d.c +++ b/gcc/config/netbsd-d.c @@ -28,6 +28,8 @@ along with GCC; see the file COPYING3. If not see #include "d/d-target.h" #include "d/d-target-def.h" +/* Implement TARGET_D_OS_VERSIONS for NetBSD targets. */ + static void netbsd_d_os_builtins (void) { @@ -35,7 +37,19 @@ netbsd_d_os_builtins (void) d_add_builtin_version ("NetBSD"); } +/* Implement TARGET_D_CRITSEC_SIZE for NetBSD targets. */ + +static unsigned +netbsd_d_critsec_size (void) +{ + /* This is the sizeof pthread_mutex_t. */ + return (POINTER_SIZE == 64) ? 48 : 28; +} + #undef TARGET_D_OS_VERSIONS #define TARGET_D_OS_VERSIONS netbsd_d_os_builtins +#undef TARGET_D_CRITSEC_SIZE +#define TARGET_D_CRITSEC_SIZE netbsd_d_critsec_size + struct gcc_targetdm targetdm = TARGETDM_INITIALIZER;