From patchwork Tue Feb 28 22:20:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 733907 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 3vXtLk2QRkz9sN8 for ; Wed, 1 Mar 2017 09:20:29 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="a4cxeup9"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=BbXBfOgwv0PzJr6o gPvbcDBKjaGVgriRhFpyOoHg4wsLcatAy/kQTGVOScOsAXfUFmaTe6hCnza2DodK 8QdkBci53Z4d8IWZW/jRgJpV3IdYwk3hm0dAVSE1Eev8XMd7/acnGVzL3YI8z6ll KJD10PgpylfUXAUP2jQBNmDSN7E= 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:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=IqgdpaWsJX96Dm0rCobq1y U/FfU=; b=a4cxeup91TVuT0lHBrwN2GtVfbCzj3KF+nx4pdls5s7n9ftAuHlJ2U PXnDpq7XGkFoR1Vw+WSqsPGnuABZkXzeAsiHW28Yj6MQq+fiDF+JOmhLVh82jLTr +FWhGK4e+pyHNdXnHfGLljjNcNVxPjQsEujM/HN0+xOBWtqLUClo8= Received: (qmail 89544 invoked by alias); 28 Feb 2017 22:20:19 -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 89526 invoked by uid 89); 28 Feb 2017 22:20:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=U*ebotcazou, sk:ebotcaz, ebotcazouadacorecom, ebotcazou@adacore.com X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 Feb 2017 22:20:16 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 361478156B for ; Tue, 28 Feb 2017 23:20:15 +0100 (CET) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RFQ9enh_ZOUg for ; Tue, 28 Feb 2017 23:20:15 +0100 (CET) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 0961681548 for ; Tue, 28 Feb 2017 23:20:15 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [Ada] PR target/79749 Date: Tue, 28 Feb 2017 23:20:13 +0100 Message-ID: <2905915.oz7gs4Bs1q@polaris> User-Agent: KMail/4.14.10 (Linux/3.16.7-53-desktop; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 This fixes the wrong code generated at -O0 with -fomit-frame-pointer in cases when the leaf function optimization could be applied (but is never at -O0). Tested on SPARC/Solaris, applied on all active branches. 2017-02-28 Eric Botcazou PR target/79749 * config/sparc/sparc.c (sparc_frame_pointer_required): Add missing condition on optimize for the leaf function test. 2017-02-28 Eric Botcazou * gcc.target/sparc/20170228-1.c: New test. Index: config/sparc/sparc.c =================================================================== --- config/sparc/sparc.c (revision 245767) +++ config/sparc/sparc.c (working copy) @@ -12180,8 +12180,9 @@ sparc_frame_pointer_required (void) if (TARGET_FLAT) return false; - /* Otherwise, the frame pointer is required if the function isn't leaf. */ - return !(crtl->is_leaf && only_leaf_regs_used ()); + /* Otherwise, the frame pointer is required if the function isn't leaf, but + we cannot use sparc_leaf_function_p since it hasn't been computed yet. */ + return !(optimize > 0 && crtl->is_leaf && only_leaf_regs_used ()); } /* The way this is structured, we can't eliminate SFP in favor of SP