From patchwork Thu Jul 25 09:42:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramana Radhakrishnan X-Patchwork-Id: 261655 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 805DE2C00B6 for ; Thu, 25 Jul 2013 19:43:02 +1000 (EST) 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:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=ki3IW/cdW7PUIrXyNSoy3cLPuEIm0GMYa/KJXFSnPsto48 cSesV4DA2/Oii1Xdta/m609MzGX+mZ8cALwhuqNxLdiQx6h744aEX3JIOc0un1P7 7JosGa7tnC9QhITjKrgQzrrpeZGN/y4adnIAd7qHthxLTB2lvmbbh7V093dFw= 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:date:from:mime-version:to:subject:content-type; s= default; bh=9KKW/BLnSnuGfOOhVDu2KaDBoBM=; b=ZfdSZo+pIaBlUeFoLrD4 27J+U6lVJtdiZ3EWwVWUNhXIDqP2aJIW2QuX3Wv6y6G8iHBcPkGoaLmeKRCuOeIU OdZxN8pImL/sygi6Jd/E6j9caoxGtOEgiM8b7yu4myKW1HqKsVOuZhCu5bSbbu9j VCHoKOBwybkC9XhEB4ql6sM= Received: (qmail 30267 invoked by alias); 25 Jul 2013 09:42:37 -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 30204 invoked by uid 89); 25 Jul 2013 09:42:36 -0000 X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL, BAYES_50, RCVD_IN_DNSWL_LOW, RDNS_NONE, SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 25 Jul 2013 09:42:35 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Thu, 25 Jul 2013 10:42:26 +0100 Received: from [10.1.209.152] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 25 Jul 2013 10:42:24 +0100 Message-ID: <51F0F300.7030604@arm.com> Date: Thu, 25 Jul 2013 10:42:24 +0100 From: Ramana Radhakrishnan User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org ;" Subject: [Patch ARM] Fix PR19599 tail X-MC-Unique: 113072510422602501 X-Virus-Found: No Hi, This fixes up the issues with PR target/19599 and the issues we've had around it. This fixes up some of the current issues we have around this. I'll follow up with a separate patch around longjmps. This puts in predicates for bx where needed - missed out CCFSM (sigh :( ), replaces uses of "Ss" with another two letter constraint in the U space rather than inventing a new one and gets rid of the issues where we missed handling HFAs in tail calls with values (sigh :( ). Ofcourse I considered using 's' and 'i' but they are unusable in general because of this in reload: case 's': if (CONST_SCALAR_INT_P (operand)) break; case 'i': if (CONSTANT_P (operand) && (! flag_pic || LEGITIMATE_PIC_OPERAND_P (operand))) win = 1; break; and our definition of LEGITIMATE_PIC_OPERAND_P doesn't allow a symbol ref. So be it. Regression tested on arm-none-linux-gnueabi arm / thumb multilibs v7-a , bootstrapped and checked it all works fine. Applied. regards Ramana 2013-07-25 Ramana Radhakrishnan PR target/19599 PR target/57731 PR target/57748 * config/arm/arm.md ("*sibcall_value_insn): Replace use of Ss with US. Adjust output for v5 and v4t. (*sibcall_value_insn): Likewise and loosen predicate on operand0. * config/arm/constraints.md ("Ss"): Rename to US. Index: gcc/config/arm/arm.md =================================================================== --- gcc/config/arm/arm.md (revision 201239) +++ gcc/config/arm/arm.md (working copy) @@ -9619,7 +9619,7 @@ ) (define_insn "*sibcall_insn" - [(call (mem:SI (match_operand:SI 0 "call_insn_operand" "Cs,Ss")) + [(call (mem:SI (match_operand:SI 0 "call_insn_operand" "Cs, US")) (match_operand 1 "" "")) (return) (use (match_operand 2 "" ""))] @@ -9630,7 +9630,7 @@ else { if (arm_arch5 || arm_arch4t) - return \" bx\\t%0\\t%@ indirect register sibling call\"; + return \" bx%?\\t%0\\t%@ indirect register sibling call\"; else return \"mov%?\\t%|pc, %0\\t%@ indirect register sibling call\"; } @@ -9639,8 +9639,8 @@ ) (define_insn "*sibcall_value_insn" - [(set (match_operand 0 "s_register_operand" "") - (call (mem:SI (match_operand:SI 1 "call_insn_operand" "Cs,Ss")) + [(set (match_operand 0 "" "") + (call (mem:SI (match_operand:SI 1 "call_insn_operand" "Cs,US")) (match_operand 2 "" ""))) (return) (use (match_operand 3 "" ""))] @@ -9651,7 +9651,7 @@ else { if (arm_arch5 || arm_arch4t) - return \"bx\\t%1\"; + return \"bx%?\\t%1\"; else return \"mov%?\\t%|pc, %1\\t@ indirect sibling call \"; } Index: gcc/config/arm/constraints.md =================================================================== --- gcc/config/arm/constraints.md (revision 201239) +++ gcc/config/arm/constraints.md (working copy) @@ -21,7 +21,7 @@ ;; The following register constraints have been used: ;; - in ARM/Thumb-2 state: t, w, x, y, z ;; - in Thumb state: h, b -;; - in both states: l, c, k, q +;; - in both states: l, c, k, q, US ;; In ARM state, 'l' is an alias for 'r' ;; 'f' and 'v' were previously used for FPA and MAVERICK registers. @@ -417,6 +417,12 @@ 0) && GET_CODE (XEXP (op, 0)) != POST_INC"))) +(define_constraint "US" + "@internal + US is a symbol reference." + (match_code "symbol_ref") +) + ;; We used to have constraint letters for S and R in ARM state, but ;; all uses of these now appear to have been removed. @@ -424,8 +430,3 @@ ;; this wasn't really a valid memory constraint. Again, all uses of ;; this now seem to have been removed. -(define_constraint "Ss" - "@internal - Ss is a symbol reference." - (match_code "symbol_ref") -)