From patchwork Thu Jul 30 20:30:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lynn A. Boger" X-Patchwork-Id: 502281 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 6A1FB140D4D for ; Fri, 31 Jul 2015 06:30: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=tuJkB4V8; 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 :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=pZu2y4H6CSDeurZZSIU+Q8tA5yBsZu+i9XIxg6ETyFmQmN NX2ErnByGlDT/WP39cESciM8/FArgjhD8sgGzu+AWWE+mCW+nRr7KPQzEfeT2oJv Ejxuz2Y2IjDgjmJ8vNjabFTQ0ZC+oy7sghO80OuS7kC21geGNg4R48RgJYigo= 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:subject:content-type; s= default; bh=OQLIYl6H03R5k/lkZ/XdAp72ow4=; b=tuJkB4V8etCLHgG39kRp mO3+wUDSMn6R5u6a0pXJPQdVB5Ayj37XJuVsS+5U+kD3dfagN97f5uwlP2i1+j+Q 8lRHBrla7N8uqJv0bInl9HLxQiM9tsDso2VhU4VxI39zDhxvhP4fPhlDuVWqJQCa H7ZCgG0lRtu+KPinlvfL00M= Received: (qmail 43698 invoked by alias); 30 Jul 2015 20:30:20 -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 43683 invoked by uid 89); 30 Jul 2015 20:30:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e19.ny.us.ibm.com Received: from e19.ny.us.ibm.com (HELO e19.ny.us.ibm.com) (129.33.205.209) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Thu, 30 Jul 2015 20:30:19 +0000 Received: from /spool/local by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 30 Jul 2015 16:30:17 -0400 Received: from d01dlp01.pok.ibm.com (9.56.250.166) by e19.ny.us.ibm.com (146.89.104.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 30 Jul 2015 16:30:14 -0400 X-MailFrom: laboger@linux.vnet.ibm.com X-RcptTo: gcc-patches@gcc.gnu.org Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id DD11638C8051 for ; Thu, 30 Jul 2015 16:30:13 -0400 (EDT) Received: from d01av05.pok.ibm.com (d01av05.pok.ibm.com [9.56.224.195]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t6UKUDkt30081252 for ; Thu, 30 Jul 2015 20:30:13 GMT Received: from d01av05.pok.ibm.com (localhost [127.0.0.1]) by d01av05.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t6UKUDZL012337 for ; Thu, 30 Jul 2015 16:30:13 -0400 Received: from oc2602623110.ibm.com (oc2602623110.ibm.com.rchland.ibm.com [9.10.86.38]) by d01av05.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t6UKUDuE012332 for ; Thu, 30 Jul 2015 16:30:13 -0400 Message-ID: <55BA8954.6070101@linux.vnet.ibm.com> Date: Thu, 30 Jul 2015 15:30:12 -0500 From: "Lynn A. Boger" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: gcc-patches Subject: [PATCH] Fix PR66870 ppc64le, ppc64 split stack X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15073020-0057-0000-0000-000000E5BCC1 X-IsSubscribed: yes The attached patch fixes a problem identified in PR66870 with split stack on ppc64 and ppc64le. If flag_split_stack is true, but the function being processed has the no_split_stack attribute, then the split stack prologue should not be generated. Bootstrapped on ppc64le-linux and ppc64-linux, passed the go and libgo testsuites (where split stack is enabled by default). gcc/ChangeLog 2015-07-30 Lynn Boger PR66870 * gcc/config/rs6000/rs6000.c: Add check for no_split_stack function attribute along with flag_split_stack check to determine when to generate split stack prologue for ppc64 and ppc64le. Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 226401) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -23736,6 +23736,10 @@ rs6000_emit_prologue (void) int using_static_chain_p = (cfun->static_chain_decl != NULL_TREE && df_regs_ever_live_p (STATIC_CHAIN_REGNUM) && call_used_regs[STATIC_CHAIN_REGNUM]); + int using_split_stack = flag_split_stack && + (lookup_attribute ("no_split_stack", DECL_ATTRIBUTES (cfun->decl)) + == NULL); + /* Offset to top of frame for frame_reg and sp respectively. */ HOST_WIDE_INT frame_off = 0; HOST_WIDE_INT sp_off = 0; @@ -24006,7 +24010,7 @@ rs6000_emit_prologue (void) && info->cr_save_p && REGNO (frame_reg_rtx) != cr_save_regno && !(using_static_chain_p && cr_save_regno == 11) - && !(flag_split_stack && cr_save_regno == 12 && sp_adjust)) + && !(using_split_stack && cr_save_regno == 12 && sp_adjust)) { cr_save_rtx = gen_rtx_REG (SImode, cr_save_regno); START_USE (cr_save_regno); @@ -24584,7 +24588,7 @@ rs6000_emit_prologue (void) if ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_ELFv2) && !using_static_chain_p) save_regno = 11; - else if (flag_split_stack || REGNO (frame_reg_rtx) == 12) + else if (using_split_stack || REGNO (frame_reg_rtx) == 12) { save_regno = 11; if (using_static_chain_p) @@ -24687,7 +24691,7 @@ rs6000_emit_prologue (void) emit_insn (gen_frame_store (reg, sp_reg_rtx, RS6000_TOC_SAVE_SLOT)); } - if (flag_split_stack && split_stack_arg_pointer_used_p ()) + if (using_split_stack && split_stack_arg_pointer_used_p ()) { /* Set up the arg pointer (r12) for -fsplit-stack code. If __morestack was called, it left the arg pointer to the old @@ -26274,7 +26278,10 @@ rs6000_expand_split_stack_prologue (void) static rtx rs6000_internal_arg_pointer (void) { - if (flag_split_stack) + if (flag_split_stack + && (lookup_attribute ("no_split_stack", DECL_ATTRIBUTES (cfun->decl)) + == NULL)) + { if (cfun->machine->split_stack_arg_pointer == NULL_RTX) {