From patchwork Mon Sep 22 15:43:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 37685 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C4DA8202A1 for ; Mon, 22 Sep 2014 15:43:32 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id z12sf1119317lbi.2 for ; Mon, 22 Sep 2014 08:43:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:sender :delivered-to:message-id:date:from:user-agent:mime-version:to:cc :subject:x-original-sender:x-original-authentication-results :content-type; bh=2wWL7ukkqZnAmtBFYmsmJbdm5RYmEF64VZo7fPNQDvM=; b=EnZXFENzTV3w4KpiVLc8VAxpns8bvbRd/+joW+NlIp+UpV9psxwJnH/Iro4OfUpxeP FhZd4sN2PzSTqyGPEJ6gvNvU8/EtSBYRrsNi1vOxq0cNS2/fpVxd/T3UtyNFSAZrYByD JBnfFGnf1QCyPB/0VpewlHSg6ht+6ZwMX8Dq2hQVI1sxZPLDsOGxFlR0zynQJxjuSPys 3D7wwnXwz4HrfbWW43M9cemiws0GKezFQ8PaNPhcSnI4/RKfOWQxTR3LyprkgfD8ycZ2 q35VPIG7qdOsFMEJ0aBjWL3Gro8kYB3IVJKUea96IHzCozufkbPpFCaWDby5pwk1vE1B 2UcA== X-Gm-Message-State: ALoCoQkwarudzRDAc0Flxlnfnlwxs1AUG39fIDAtYAbWQdBAJhOJeQ29+eDdxEGF+l23flvJ9pDe X-Received: by 10.180.24.72 with SMTP id s8mr1555560wif.1.1411400611607; Mon, 22 Sep 2014 08:43:31 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.4 with SMTP id lk4ls539466lac.41.gmail; Mon, 22 Sep 2014 08:43:31 -0700 (PDT) X-Received: by 10.152.21.98 with SMTP id u2mr26970311lae.60.1411400611357; Mon, 22 Sep 2014 08:43:31 -0700 (PDT) Received: from mail-lb0-x232.google.com (mail-lb0-x232.google.com [2a00:1450:4010:c04::232]) by mx.google.com with ESMTPS id uo9si14887181lbb.134.2014.09.22.08.43.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Sep 2014 08:43:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::232 as permitted sender) client-ip=2a00:1450:4010:c04::232; Received: by mail-lb0-f178.google.com with SMTP id z12so4396781lbi.37 for ; Mon, 22 Sep 2014 08:43:31 -0700 (PDT) X-Received: by 10.112.53.230 with SMTP id e6mr3270621lbp.100.1411400611245; Mon, 22 Sep 2014 08:43:31 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp260749lbb; Mon, 22 Sep 2014 08:43:29 -0700 (PDT) X-Received: by 10.70.34.104 with SMTP id y8mr570499pdi.7.1411400609040; Mon, 22 Sep 2014 08:43:29 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id h1si16300491pdp.95.2014.09.22.08.43.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Sep 2014 08:43:28 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-378352-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 10504 invoked by alias); 22 Sep 2014 15:43:14 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 10493 invoked by uid 89); 22 Sep 2014 15:43:13 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f182.google.com Received: from mail-pd0-f182.google.com (HELO mail-pd0-f182.google.com) (209.85.192.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 22 Sep 2014 15:43:10 +0000 Received: by mail-pd0-f182.google.com with SMTP id p10so4461061pdj.41 for ; Mon, 22 Sep 2014 08:43:08 -0700 (PDT) X-Received: by 10.68.238.99 with SMTP id vj3mr25761927pbc.43.1411400588640; Mon, 22 Sep 2014 08:43:08 -0700 (PDT) Received: from [10.1.1.2] (58-6-183-210.dyn.iinet.net.au. [58.6.183.210]) by mx.google.com with ESMTPSA id y4sm9736335pdm.1.2014.09.22.08.43.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Sep 2014 08:43:07 -0700 (PDT) Message-ID: <54204387.5090105@linaro.org> Date: Tue, 23 Sep 2014 01:43:03 +1000 From: Kugan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Marcus Shawcroft , Richard Earnshaw Subject: [PATCH][AArch64] LR register not used in leaf functions X-IsSubscribed: yes X-Original-Sender: kugan.vivekanandarajah@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::232 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 AArch64 has the same issue ARM had where the LR register was not used in leaf functions. This was reported in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42017. In AArch64, this test-case need to be added with more live ranges for the need for the LR_REGNUM. i.e test-case in the PR needs additional loops up to r31 for the case AArch64 to see this. The same fix (from the thread https://gcc.gnu.org/ml/gcc-patches/2011-04/msg02191.html) which went into ARM should apply to AArch64 as well. Regression tested on qemu for aarch64-none-linux-gnu with no new regressions. Is this OK for trunk? Thanks, Kugan gcc/ChangeLog: 2014-09-23 Kugan Vivekanandarajah * config/aarch64/aarch64.h (EPILOGUE_USES): Return true only after epilogue_completed is true. diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index db950da..b3e4585 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -309,7 +309,7 @@ extern unsigned long aarch64_tune_flags; considered live at the start of the called function. */ #define EPILOGUE_USES(REGNO) \ - ((REGNO) == LR_REGNUM) + (epilogue_completed && (REGNO) == LR_REGNUM) /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, the stack pointer does not matter. The value is tested only in