From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62331 invoked by alias); 21 Apr 2016 11:39:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 62141 invoked by uid 89); 21 Apr 2016 11:39:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,LIKELY_SPAM_BODY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=Usd, ARCompact, UD:constraints.md, sk:668b60a X-HELO: mail-wm0-f41.google.com Received: from mail-wm0-f41.google.com (HELO mail-wm0-f41.google.com) (74.125.82.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 21 Apr 2016 11:39:50 +0000 Received: by mail-wm0-f41.google.com with SMTP id v188so240839058wme.1 for ; Thu, 21 Apr 2016 04:39:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=c0D7/T0pVlFhFebXVAxBHa9puDGTmjWNPeoO1FGO/Os=; b=BgfgS110o80Rpp6jmlYZ+dCHPP7ietfwL+YYpSoMJ3P6dy4z46M875qdp/KUKk5sgj /IRb7NlaW4V5eOrvpPJU1Qd7V1WIPeJtUYkCu59yQnAXbjjQt1rNhbIkf1aQOf1Xk/fw pr1dBRLgTi+fkzV4dxgaKyGoDsS18QFlcU6u+Zc/y+saQjwY5QPZFZ/W61S8IEZq0uDz zcdBptJrpXw3odd5ayhKMQBvjlKmSHdG2T3l2QkrhDQ3LKD67NlZgjPZLB6Cq+STx/kr 8AJyZdxxG6gsbR8UGzR4jWJTHj2keYSKVKG4I0LsBnmdikg4pX5HSVQGCuNAK2QijuhB zl6A== X-Gm-Message-State: AOPr4FWz/6MoHH7HrZ8QjB8tZdnFPD+yeyT8+cpgeId71FWsYIW5/+WSDLPuSLk+1nr1LA== X-Received: by 10.194.74.231 with SMTP id x7mr13602109wjv.60.1461238787500; Thu, 21 Apr 2016 04:39:47 -0700 (PDT) Received: from localhost (host86-155-190-186.range86-155.btcentralplus.com. [86.155.190.186]) by smtp.gmail.com with ESMTPSA id b2sm2862130wmb.9.2016.04.21.04.39.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Apr 2016 04:39:46 -0700 (PDT) From: Andrew Burgess To: gcc-patches@gcc.gnu.org, gnu@amylaar.uk Cc: noamca@mellanox.com, Claudiu.Zissulescu@synopsys.com, Andrew Burgess Subject: [PATCHv2 3/7] gcc/arc: convert some constraints to define_constraint Date: Thu, 21 Apr 2016 11:39:00 -0000 Message-Id: <98b5e246cec43e26de8f671988cc489cadec0c3a.1461238348.git.andrew.burgess@embecosm.com> In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg01147.txt.bz2 The define_memory_constraint allows for the address operand to be reloaded into a base register. However, for the constraints 'Us<' and 'Us>', which are used for matching 'push' and 'pop' instructions moving the address into a base register is not helpful. The constraints then should be define_constraint, not define_memory_constraint. Similarly the Usd constraint, used for generating small data area memory accesses, can't have its operand loaded into a register as the relocation for small data area symbols only works within ld/st instructions. gcc/ChangeLog: * config/arc/constraints.md (Usd): Convert to define_constraint. (Us<): Likewise. (Us>): Likewise. --- gcc/ChangeLog.NPS400 | 7 +++++++ gcc/config/arc/constraints.md | 18 +++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/gcc/config/arc/constraints.md b/gcc/config/arc/constraints.md index 668b60a..b6954ad 100644 --- a/gcc/config/arc/constraints.md +++ b/gcc/config/arc/constraints.md @@ -269,11 +269,15 @@ (and (match_code "mem") (match_test "compact_store_memory_operand (op, VOIDmode)"))) -(define_memory_constraint "Usd" - "@internal - A valid _small-data_ memory operand for ARCompact instructions" - (and (match_code "mem") - (match_test "compact_sda_memory_operand (op, VOIDmode)"))) +; Don't use define_memory_constraint here as the relocation patching +; for small data symbols only works within a ld/st instruction and +; define_memory_constraint may result in the address being calculated +; into a register first. +(define_constraint "Usd" + "@internal + A valid _small-data_ memory operand for ARCompact instructions" + (and (match_code "mem") + (match_test "compact_sda_memory_operand (op, VOIDmode)"))) (define_memory_constraint "Usc" "@internal @@ -283,7 +287,7 @@ ;; ??? the assembler rejects stores of immediates to small data. (match_test "!compact_sda_memory_operand (op, VOIDmode)"))) -(define_memory_constraint "Us<" +(define_constraint "Us<" "@internal Stack pre-decrement" (and (match_code "mem") @@ -291,7 +295,7 @@ (match_test "REG_P (XEXP (XEXP (op, 0), 0))") (match_test "REGNO (XEXP (XEXP (op, 0), 0)) == SP_REG"))) -(define_memory_constraint "Us>" +(define_constraint "Us>" "@internal Stack post-increment" (and (match_code "mem") -- 2.6.4