From patchwork Thu Jul 12 14:22:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramana Radhakrishnan X-Patchwork-Id: 141828 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1580550ljj; Thu, 12 Jul 2018 07:22:24 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdQF9iXsPOOcy6KuwrS7wRvu4eX3lsYf2fjPi7pMTQTU6sMdZqsxOmfxAlFm3p9ftm9s+/s X-Received: by 2002:a62:c1:: with SMTP id 184-v6mr2697149pfa.100.1531405344008; Thu, 12 Jul 2018 07:22:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531405344; cv=none; d=google.com; s=arc-20160816; b=HJBOWM/iNMDEhdGgzVl9nDhY6hqal/Vc4xUFdhXo2u2WxZGCvPaxiKtNUSyNlhfBzo KV6deslvp2gyXYpawcr0wtzzygAFccye3b9PhCxdDE6GrBjEUd3TusuWzy2EisIq+kOm /wqs74IOv1s+zU3NkBqvh0Ji9rTJAPlbYuBIwMBT9v9QaoViw+17NIGAhj6S8oyBB/D9 Rj2TJ1jHX+u9vcRvxe7PsX3czVooQQXYi4YR11u8U7p/S4m2MCqhAJv0z9XSzDW+IoFP lPbAl6Q2VAYUWrAicOKKgIHc3YDYcZ3BoDAKxtn3hBsX2cvFQZOhhdNkzNLyr0WLl9Ks BwKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:date:message-id:cc:subject:from:to :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=CNOodXaJ/Mk/XMQnR5cerXJbrnRi8HsxfZJrYSaa28A=; b=06SipLmr5OeEG996OXDQchLn5neTfwFnF24zpYdw+BPSi9KSXutOQHX2F/F4ehIE7Q ZTZyuinDx2q1RG6d6X1Bi8WQEPjtfsSb8ci4WMPG4QWhG8RJ28aBeei47LHUr4Zd8uDd 5LEQvgIEw/OE3u59vpSr9cYFmNNbp7lUiCuReAijDUWEBn5yD6zsi9jHrfjaFYYbP3h8 Ci0QDXX60sRrVJ/1UyNXsOUwLqSbR04yJ2Ir5C9/inGQGon6dLNGp8aHZFzF7+IHX++r U6CLcO4h3GgUtSSyp1gX20ZSE2cggJLMNTTNA+/XRMIOg/EEkamYA3CNxRCt1ny57SW9 m5Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=nfYZZzOm; dkim=neutral (body hash did not verify) header.i=@armh.onmicrosoft.com header.s=selector1-arm-com header.b="eU45DH/+"; spf=pass (google.com: domain of gcc-patches-return-481430-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-481430-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id k14-v6si23216073pfd.23.2018.07.12.07.22.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jul 2018 07:22:23 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-481430-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=nfYZZzOm; dkim=neutral (body hash did not verify) header.i=@armh.onmicrosoft.com header.s=selector1-arm-com header.b="eU45DH/+"; spf=pass (google.com: domain of gcc-patches-return-481430-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-481430-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:cc:message-id:date:mime-version:content-type; q= dns; s=default; b=d6DJCM46ETnKOMTw26DHUOGGAoGcDLbh0Ec7A9lSda0+3q TpEiXFs2mf3gbtoaLOZ9MG34tALP5TL+hTUzWYw/pPbgpXolOBHD56DND3B5IHUZ bjBcPRXBmFIlaq9QdoE0t0Sx5QSdoHDyAEGXgcT3FPZ8WkPA8r4LMBS+2tYng= 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:to :from:subject:cc:message-id:date:mime-version:content-type; s= default; bh=J5bLTX+cxjXY9tpoxn2b3y+G5gg=; b=nfYZZzOmtoR7AOYclZWK Y/LeM4tnnEtLRv2H+rlBnMY6FMAlpydz4E934vyFu+v9iqIsvbyH8IYqlw1Qkv5J iQxSFi1/myNjgBcfI3V9NyHGSM62NkF78gTwIgQCuVuB0r/6IFYoj3KBQZx1GxVF tiO9Zofv/pqJZcVlE992d/c= Received: (qmail 25493 invoked by alias); 12 Jul 2018 14:22:13 -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 25484 invoked by uid 89); 12 Jul 2018 14:22:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: EUR04-VI1-obe.outbound.protection.outlook.com Received: from mail-eopbgr80058.outbound.protection.outlook.com (HELO EUR04-VI1-obe.outbound.protection.outlook.com) (40.107.8.58) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Jul 2018 14:22:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z/8Zv+dKcfZL1PKTHCfBiTY2LxqLq8otrwCOm/HDxiI=; b=eU45DH/+jaji2nH+y2BtDzCH51B7BzzoRnoPUmPRqO77GHxmvpeY16q8+WGXdSgRbN+uphI/UFUtasJPyjLIbFhr+/GrUPprr10k5har3hnTFCMbnW/dJS/n3c0glNPyzqVYNLNlRuwZbamb5bVR0QkZZ7rtnanCupZNY//3dLU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ramana.Radhakrishnan@arm.com; Received: from [10.2.206.71] (217.140.96.140) by AM4PR08MB2786.eurprd08.prod.outlook.com (2603:10a6:205:d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.952.17; Thu, 12 Jul 2018 14:22:06 +0000 To: GCC Patches From: Ramana Radhakrishnan Subject: [Patch AArch64] Add early clobber for the store_exclusive patterns. Cc: nd , Richard Earnshaw , James Greenhalgh Message-ID: <1158ef7e-58c9-a33e-75a4-65a410499493@arm.com> Date: Thu, 12 Jul 2018 15:22:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Thunderbird/57.0 MIME-Version: 1.0 Return-Path: ramana.radhakrishnan@arm.com Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) Hi, I've had this in my patch stack after discovering the gas issue where we weren't warning on cases that were unpredictable according to the architecture. I would like to backport this fix to earlier GCC branches too. I did a few attempts but I haven't been able to trigger the unpredictable behaviour. Bootstrapped and regression tested on AArch64 , no regressions. Ok ? Thanks, Ramana * config/aarch64/atomics.md (aarch64_store_exclusive): Add early clobber. commit 0608cb64b97368dc1bbea87e3a9541cfb832c015 Author: Ramana Radhakrishnan Date: Tue Jun 12 16:03:24 2018 +0100 [Patch AArch64] Add early clobber for aarch64_store_exclusive. diff --git a/gcc/config/aarch64/atomics.md b/gcc/config/aarch64/atomics.md index 68dc65c..cd8c44e 100644 --- a/gcc/config/aarch64/atomics.md +++ b/gcc/config/aarch64/atomics.md @@ -530,7 +530,7 @@ ) (define_insn "aarch64_store_exclusive" - [(set (match_operand:SI 0 "register_operand" "=r") + [(set (match_operand:SI 0 "register_operand" "=&r") (unspec_volatile:SI [(const_int 0)] UNSPECV_SX)) (set (match_operand:ALLI 1 "aarch64_sync_memory_operand" "=Q") (unspec_volatile:ALLI