From patchwork Mon May 18 02:54:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 473244 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 2418F14029C for ; Mon, 18 May 2015 12:54:28 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=n2xBkxTt; 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:date :from:to:cc:subject:message-id:mime-version:content-type :in-reply-to; q=dns; s=default; b=yqwad7a5gcx/Byewk+XjYT4oDiMaDq ABPuZmFeTC5ykiN7ImVT+hqPutYc2PZxRi4OjfUrECP0XSrHn4nsjFdX91IBKAP8 /lJy7WGNZnJxk5AheB7bq0L39x8YuSaDtcdp/dbYlBMlDajEoolkcUCfoi/3rJjV oT0ptlRJI3sXA= 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:date :from:to:cc:subject:message-id:mime-version:content-type :in-reply-to; s=default; bh=V3aScrNKAaFI45f91hK2wXHwEYA=; b=n2xB kxTtK0Ak90GtU0Wa0fB/b0Rc9YPyJ/pevFwnuuN9tlzDOaoQVyXCoJ4LvJiwWo95 pOyuqkcW9TpIca13aKKy2Kpl2ZT8tMHGTlAdyn0ZJZ+RLTWlVopXXMmuO2kQgnsw B2EBo5FvEo7VfjFeR4fecqrc7NMkg81iBf4TKKc= Received: (qmail 97431 invoked by alias); 18 May 2015 02:54:21 -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 97390 invoked by uid 89); 18 May 2015 02:54:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f176.google.com Received: from mail-pd0-f176.google.com (HELO mail-pd0-f176.google.com) (209.85.192.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 18 May 2015 02:54:14 +0000 Received: by pdea3 with SMTP id a3so127737129pde.2 for ; Sun, 17 May 2015 19:54:12 -0700 (PDT) X-Received: by 10.70.131.193 with SMTP id oo1mr40433258pdb.63.1431917652496; Sun, 17 May 2015 19:54:12 -0700 (PDT) Received: from bubble.grove.modra.org (CPE-58-160-155-134.oycza5.sa.bigpond.net.au. [58.160.155.134]) by mx.google.com with ESMTPSA id cy5sm8289141pdb.85.2015.05.17.19.54.11 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 May 2015 19:54:11 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id D8908EA0077; Mon, 18 May 2015 12:24:07 +0930 (ACST) Date: Mon, 18 May 2015 12:24:07 +0930 From: Alan Modra To: gcc-patches@gcc.gnu.org Cc: David Edelsohn Subject: [PATCH 1/4] rs6000_stack_info changes for -fsplit-stack Message-ID: <20150518025407.GU6140@bubble.grove.modra.org> Mail-Followup-To: gcc-patches@gcc.gnu.org, David Edelsohn MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20150518025234.GT6140@bubble.grove.modra.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes This patch changes rs6000_stack_info to keep save areas offsets even when not used. I need lr_save_offset valid for split-stack, and it seemed reasonable to treat the other offsets the same. Not zeroing the offsets requires just one change in code that uses them, the use_backchain_to_restore_sp expression in rs6000_emit_epilogue, not counting the debug_stack_info changes. * config/rs6000/rs6000.c (rs6000_stack_info): Don't zero offsets when not saving registers. (debug_stack_info): Adjust to omit printing unused offsets, as before. (rs6000_emit_epilogue): Adjust use_backchain_to_restore_sp expression. diff -urp gcc-virgin/gcc/config/rs6000/rs6000.c gcc-stack-info1/gcc/config/rs6000/rs6000.c --- gcc-virgin/gcc/config/rs6000/rs6000.c 2015-05-15 14:15:38.157244403 +0930 +++ gcc-stack-info1/gcc/config/rs6000/rs6000.c 2015-05-18 09:44:34.027608414 +0930 @@ -22014,31 +22014,6 @@ rs6000_stack_info (void) else info_ptr->push_p = non_fixed_size > (TARGET_32BIT ? 220 : 288); - /* Zero offsets if we're not saving those registers. */ - if (info_ptr->fp_size == 0) - info_ptr->fp_save_offset = 0; - - if (info_ptr->gp_size == 0) - info_ptr->gp_save_offset = 0; - - if (! TARGET_ALTIVEC_ABI || info_ptr->altivec_size == 0) - info_ptr->altivec_save_offset = 0; - - /* Zero VRSAVE offset if not saved and restored. */ - if (! TARGET_ALTIVEC_VRSAVE || info_ptr->vrsave_mask == 0) - info_ptr->vrsave_save_offset = 0; - - if (! TARGET_SPE_ABI - || info_ptr->spe_64bit_regs_used == 0 - || info_ptr->spe_gp_size == 0) - info_ptr->spe_gp_save_offset = 0; - - if (! info_ptr->lr_save_p) - info_ptr->lr_save_offset = 0; - - if (! info_ptr->cr_save_p) - info_ptr->cr_save_offset = 0; - return info_ptr; } @@ -22144,28 +22119,28 @@ debug_stack_info (rs6000_stack_t *info) if (info->calls_p) fprintf (stderr, "\tcalls_p = %5d\n", info->calls_p); - if (info->gp_save_offset) + if (info->gp_size) fprintf (stderr, "\tgp_save_offset = %5d\n", info->gp_save_offset); - if (info->fp_save_offset) + if (info->fp_size) fprintf (stderr, "\tfp_save_offset = %5d\n", info->fp_save_offset); - if (info->altivec_save_offset) + if (info->altivec_size) fprintf (stderr, "\taltivec_save_offset = %5d\n", info->altivec_save_offset); - if (info->spe_gp_save_offset) + if (info->spe_gp_size == 0) fprintf (stderr, "\tspe_gp_save_offset = %5d\n", info->spe_gp_save_offset); - if (info->vrsave_save_offset) + if (info->vrsave_size) fprintf (stderr, "\tvrsave_save_offset = %5d\n", info->vrsave_save_offset); - if (info->lr_save_offset) + if (info->lr_save_p) fprintf (stderr, "\tlr_save_offset = %5d\n", info->lr_save_offset); - if (info->cr_save_offset) + if (info->cr_save_p) fprintf (stderr, "\tcr_save_offset = %5d\n", info->cr_save_offset); if (info->varargs_save_offset) @@ -24736,7 +24711,9 @@ rs6000_emit_epilogue (int sibcall) here will not trigger at the moment; We don't actually need a frame pointer for alloca, but the generic parts of the compiler give us one anyway. */ - use_backchain_to_restore_sp = (info->total_size > 32767 - info->lr_save_offset + use_backchain_to_restore_sp = (info->total_size + (info->lr_save_p + ? info->lr_save_offset + : 0) > 32767 || (cfun->calls_alloca && !frame_pointer_needed)); restore_lr = (info->lr_save_p