From patchwork Thu Jan 11 15:07:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 859180 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-470838-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="WDT2d9pG"; 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 3zHTlb725Jz9s8J for ; Fri, 12 Jan 2018 02:08:10 +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 :message-id:subject:from:to:date:content-type:mime-version; q= dns; s=default; b=iUNSH4FDfZzLBVL/yMz/Cf0Z0bmWZ5WXebnVOyh3bn0GJI CCoC5dkFjsGqUfXATbtttxxkQOHEesWcFpCQY3s7Q/UeNLPmXobzvRpM7+EkmMdK ylXwstwzIlsEbARkTCRmhHP3c2wEt6jf2S2PwvzqUrhueHnbd3qqwuYa9bXDY= 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 :message-id:subject:from:to:date:content-type:mime-version; s= default; bh=mRWA7ZDKwmDFWtnxtMmjQ+9N948=; b=WDT2d9pGHrfIU+/5RlS/ BjL4GnWz1nx+CihL2JElfdzFgHHYhVnhZ0YmcoSY4Nxvv6DZN6A+JPqzkPYkidC/ /TVA1/+INbNGK2R1iMH2UHctP79S7H12i6boNZWy3KVMOeRbdZcbAj2o+bSf/jUc 7lBVuFWXH62PJc0ZcShjqpo= Received: (qmail 32010 invoked by alias); 11 Jan 2018 15:08:04 -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 31978 invoked by uid 89); 11 Jan 2018 15:08:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-9.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*M:online, 256385, H*MI:online, H*r:172.20.26 X-HELO: mailout06.t-online.de Received: from mailout06.t-online.de (HELO mailout06.t-online.de) (194.25.134.19) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 11 Jan 2018 15:08:01 +0000 Received: from fwd00.aul.t-online.de (fwd00.aul.t-online.de [172.20.26.147]) by mailout06.t-online.de (Postfix) with SMTP id 6C37341C43A0; Thu, 11 Jan 2018 16:07:59 +0100 (CET) Received: from [192.168.0.55] (GoTMWrZb8hWuGJUvWWJjg9kMLq3VIqfvAnAD6AVMqJGcsG+AYXAvZ4udIPkq7LHZGR@[163.58.16.102]) by fwd00.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1eZeSN-2NpR8C0; Thu, 11 Jan 2018 16:07:51 +0100 Message-ID: <1515683259.12491.10.camel@t-online.de> Subject: [RX] Fix PR 81821 From: Oleg Endo To: gcc-patches , Nick Clifton Date: Fri, 12 Jan 2018 00:07:39 +0900 Mime-Version: 1.0 X-IsSubscribed: yes Hi, The attached patch fixes PR 81821.  It is the same as the patch proposed in the PR.  I have briefly checked it in a private application that uses atomic variables and I think it's rather obvious. I have added atomics support on RX in GCC 7 and that was an initial bug.  Thus I'd like to also apply it to the GCC 7 branch. OK for trunk and GCC 7? Cheers, Oleg gcc/ChangeLog: * config/rx/rx.md (BW): New mode attribute. (sync_lock_test_and_setsi): Add mode suffix to insn output. Index: gcc/config/rx/rx.md =================================================================== --- gcc/config/rx/rx.md (revision 256385) +++ gcc/config/rx/rx.md (working copy) @@ -2167,6 +2167,7 @@ [(plus "add") (minus "sub") (ior "ior") (xor "xor") (and "and")]) (define_mode_iterator QIHI [QI HI]) +(define_mode_attr BW [(QI "B") (HI "W")]) (define_insn "sync_lock_test_and_setsi" [(set (match_operand:SI 0 "register_operand" "=r,r") @@ -2208,7 +2209,7 @@ (set (match_dup 1) (match_operand:QIHI 2 "register_operand" "0"))] "" - "xchg\t%1, %0" + "xchg\t%1., %0" [(set_attr "length" "6") (set_attr "timings" "22")] )