From patchwork Wed Oct 10 15:13:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greta Yorsh X-Patchwork-Id: 190690 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]) by ozlabs.org (Postfix) with SMTP id 96B042C0087 for ; Thu, 11 Oct 2012 02:13:58 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1350486838; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=fY//mzPF7ZYcuteuZdcN WMCXe94=; b=Zi34Ov2/0E/7dA2cWsWlB7r4X/ymwpgNq79VyuLmvHPKEQi1naPK CXIe1zh1KN+tnF0spZysIQlaSPUaQC2l+A2PKhDym8wlMITY3uMUO8atTBxT+A5O CKb0nGQdFvgfqYP6cHNICCd/rQKqKSUnnwwEhBahbOTY9So0YItEZQE= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:From:To:Cc:Subject:Date:Message-ID:MIME-Version:X-MC-Unique:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=uXXr3EPEC16tM+vWop/xL4XNPHTHe3sk5nrm1aCqmAFpA09mrc3tHU22liabuA Sd7NSjLi/jaE1E3Rb9pNXABOVsU+Y2YTo+auBqeEr36LFoszSlWVn6wVQ/YzjheY 8II+uesEGWGTH9ySNl0/5A70V+6HikIzs2UBEISA1treo=; Received: (qmail 21830 invoked by alias); 10 Oct 2012 15:13:52 -0000 Received: (qmail 21817 invoked by uid 22791); 10 Oct 2012 15:13:50 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, MSGID_MULTIPLE_AT, RCVD_IN_DNSWL_LOW, TW_QE X-Spam-Check-By: sourceware.org Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 10 Oct 2012 15:13:43 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Wed, 10 Oct 2012 16:13:41 +0100 Received: from e103227vm ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 10 Oct 2012 16:13:41 +0100 From: "Greta Yorsh" To: "GCC Patches" Cc: "Ramana Radhakrishnan" , "Richard Earnshaw" , , Subject: [Patch, ARM] cleanup prologue_use pattern Date: Wed, 10 Oct 2012 16:13:37 +0100 Message-ID: <002701cda6f9$d3204f70$7960ee50$@yorsh@arm.com> MIME-Version: 1.0 X-MC-Unique: 112101016134127001 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 The pattern prologue_use is emitted for both prologue and epilogue. In particular, the assembly comment "@sp needed for prologue" is printed out for both prologue and epilogue. This patch adds a separate pattern for epilogue_use and replaces prologue_use with epilogue_use where appropriate. No regression on qemu for arm-none-eabi. Ok for trunk? Thanks, Greta 2012-09-17 Greta Yorsh * config/arm/arm.md (UNSPEC_EPILOGUE_USE): New unspec value. (sibcall_epilogue): Use UNSPEC_EPILOGUE_USE instead of UNSPEC_PROLOGUE_USE. (epilogue_use): New define_insn. (epilogue): Use gen_epilogue_use instead of gen_prologue_use. * config/arm/arm.c (arm_expand_epilogue): Likewise. (thumb1_expand_epilogue) Likewise. diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index dd073da..f23c2d0 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -22581,7 +22581,7 @@ thumb1_expand_epilogue (void) /* Emit a USE (stack_pointer_rtx), so that the stack adjustment will not be deleted. */ - emit_insn (gen_prologue_use (stack_pointer_rtx)); + emit_insn (gen_epilogue_use (stack_pointer_rtx)); if (crtl->profile || !TARGET_SCHED_PROLOG) emit_insn (gen_blockage ()); @@ -22805,7 +22805,7 @@ arm_expand_epilogue (bool really_return) /* Emit USE(stack_pointer_rtx) to ensure that stack adjustment is not deleted. */ - emit_insn (gen_prologue_use (stack_pointer_rtx)); + emit_insn (gen_epilogue_use (stack_pointer_rtx)); } else { @@ -22823,7 +22823,7 @@ arm_expand_epilogue (bool really_return) emit_insn (gen_movsi (stack_pointer_rtx, hard_frame_pointer_rtx)); /* Emit USE(stack_pointer_rtx) to ensure that stack adjustment is not deleted. */ - emit_insn (gen_prologue_use (stack_pointer_rtx)); + emit_insn (gen_epilogue_use (stack_pointer_rtx)); } } else @@ -22841,7 +22841,7 @@ arm_expand_epilogue (bool really_return) GEN_INT (amount))); /* Emit USE(stack_pointer_rtx) to ensure that stack adjustment is not deleted. */ - emit_insn (gen_prologue_use (stack_pointer_rtx)); + emit_insn (gen_epilogue_use (stack_pointer_rtx)); } } diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index a60e659..6a910a3 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -81,6 +81,7 @@ ; instructions setting registers for EH handling ; and stack frame generation. Operand 0 is the ; register to "use". + UNSPEC_EPILOGUE_USE ; Same for epilogue. UNSPEC_CHECK_ARCH ; Set CCs to indicate 26-bit or 32-bit mode. UNSPEC_WSHUFH ; Used by the intrinsic form of the iWMMXt WSHUFH instruction. UNSPEC_WACC ; Used by the intrinsic form of the iWMMXt WACC instruction. @@ -10610,7 +10611,7 @@ "TARGET_EITHER" " if (crtl->calls_eh_return) - emit_insn (gen_prologue_use (gen_rtx_REG (Pmode, 2))); + emit_insn (gen_epilogue_use (gen_rtx_REG (Pmode, 2))); if (TARGET_THUMB1) { thumb1_expand_epilogue (); @@ -10644,7 +10645,7 @@ ;; does not think that it is unused by the sibcall branch that ;; will replace the standard function epilogue. (define_expand "sibcall_epilogue" - [(parallel [(unspec:SI [(reg:SI LR_REGNUM)] UNSPEC_PROLOGUE_USE) + [(parallel [(unspec:SI [(reg:SI LR_REGNUM)] UNSPEC_EPILOGUE_USE) (unspec_volatile [(return)] VUNSPEC_EPILOGUE)])] "TARGET_32BIT" " @@ -11267,6 +11268,12 @@ [(set_attr "length" "0")] ) +(define_insn "epilogue_use" + [(unspec:SI [(match_operand:SI 0 "register_operand" "")] UNSPEC_EPILOGUE_USE)] + "" + "%@ %0 needed for epilogue" + [(set_attr "length" "0")] +) ;; Patterns for exception handling