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: 943064 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-481430-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="XwBJ3//U"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.b="eU45DH/+"; 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 41RJ6h4YV3z9s1R for ; Fri, 13 Jul 2018 00:22:19 +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:to :from:subject:cc:message-id:date:mime-version:content-type; q= dns; s=default; b=FU1J+EwfnTaPWn69nGYh8DzpD04LY/SDitUoNmfR/aroH/ 0HtPXGWEEdeBMSVwG/SLj5boMzszvx46AfLSeHiTT6Ci0c3AFVS1AuDgvfvbodg5 aqE1Gc5AEn8p7SUAk4KwX0lxwh9a+Uqo723xedSE2csCX4ZjicWgml/y5PjTc= 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=XwBJ3//UxaDjQS6VWOup R8CG085LDGsxseHKfR5cMLe//3+V2lJdZBm+yzkNSrfHEEaSxeMPeGroC+iycqNh VkQmoDFshyl5j6se4r6PbU0xjRnfQ02/Nf0j8EGOziC83Cf0Xp7oGMLq9X8X/TEK wAvklBNYoq5V9adYIP1kSco= 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 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