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: 392032 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 76BD8140174 for ; Tue, 23 Sep 2014 01:43:21 +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:cc:subject:content-type; q=dns; s=default; b=uBDnI0gqmAXIV5qPayiFgztCz1xbWZ+ljikaEEe4zSY jWOjfSKe1L+CuSOAMVOdwQY8iTkxPE/X12OxuAcFNwXa4L8SGofM+gGa/kLOuInK 9+QwqfEkXK+7Q21Avdfz5QhxLZlMHbitPTEgS5Hhr1phBkLuTkzz/XrbSoSIntwU = 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:cc:subject:content-type; s=default; bh=PrepPVraP3AUgw7PZLVBjEX5DVo=; b=ZuyGRujirmqAs9Et2 qNOjagBWA+zIYYk8KJ1mPYbM7gN+tQiN6r+qg+PduRQEn68YzYzBB3k+hkgLOQlg 4IZeo1ymASch7qBzcYWZUOCJjUQ/r5T8BvrPv7CgHmCaSHJbi0SvO2MO9KVI+TfJ Ic90Nq/ZZZ1gM9dw0heHRqXwdw= Received: (qmail 10504 invoked by alias); 22 Sep 2014 15:43:14 -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 10493 invoked by uid 89); 22 Sep 2014 15:43:13 -0000 Authentication-Results: sourceware.org; auth=none 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-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:content-type; bh=vyxQxnLKXO2PNOzORlZPM1Y9Ru/7tStc2AjyqrYChEk=; b=EnxZL9VKz5dyRc4ZNYjQ0g8Qs50BxbTloOGZEFa9Uyb7jOAOcDSnUUHBVPdmza8U/0 9QX5TVzzdf5PZwCdvunEKmydIC+c2pngWKmua7ogB+ctaJFn/ZF6BnKvNln6l0/a69b1 Q3Q1P1N6enCqp98D0qeFhz9WxAg7J/OX53SA8UCwZ3Jv63BOIhlj6f9exM8MMXIP8pfz eZuVZfm0IaV6WPGc2CdFOv4zepGA7MPq/EXJM2f67t9GYZmtqf2MssMghijINTZB59b8 8AMnFh7PduDvWnKjLwX1JzHHApZHTlZAgfmmR7XJxcOiUISljLnqoqJ+ZmMttmYh+U27 yGkQ== X-Gm-Message-State: ALoCoQmuwbA30pp/CfA69JcQXpRp4L1l4KtSFsqWUlgkIyGFkhjfOHJzQssrzPgMwPnlAhROcg+f 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 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