From patchwork Thu Jun 5 11:58:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Shawcroft X-Patchwork-Id: 356319 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 09436140080 for ; Thu, 5 Jun 2014 21:59:30 +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:subject:content-type; q= dns; s=default; b=hmGh7ndcOLeF5UHJ8MRrrTNGgYkLvb1JYqy2aJtw0lQ/Sa RFqa1wCkbzhOWej00fYWFpvpzodbzeZxm0rV4nBapEZgWLDAIq6iCTH44wvWk4Cn wZ0Oqr3D9jvxAxxsMonE2vuZcYESaxj31KWEDfWiXGbtPvJQ0tZLNjQ482pZw= 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=tMYojyT4I1HK03cLfzQYJmiOz3k=; b=uUkG3HXqO3Va4XrRG6mb FRH0b26EFPMv2zX/uL9Zq3/kxEHmJ/QhGKvbgq0mC9iMC7+Ijzn4eY97WZnZSwZw T7Owshpblr6lo9sZ3PSi0uLZN8PfyPhyofI0GMoMB8MJBizEgucNsiPZuvQAgKxA ufFwWyuzo7lG8jV+iO0fAks= Received: (qmail 15022 invoked by alias); 5 Jun 2014 11:58:47 -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 14921 invoked by uid 89); 5 Jun 2014 11:58:46 -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, RAR_ATTACHED, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Jun 2014 11:58:45 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Thu, 05 Jun 2014 12:58:43 +0100 Received: from [10.1.207.52] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 5 Jun 2014 12:58:37 +0100 Message-ID: <53905B70.4090908@arm.com> Date: Thu, 05 Jun 2014 12:58:40 +0100 From: Marcus Shawcroft User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [AARch64][COMMITTED] Move saved_varargs_size. X-MC-Unique: 114060512584302101 I've just committed the attached to co-locate saved_varargs_size with the other target specific frame related state... /Marcus 2014-06-05 Marcus Shawcroft * config/aarch64/aarch64.h (machine_function): Move saved_varargs_size from here... (aarch64_frameGTY): ... to here. * config/aarch64/aarch64.c (aarch64_expand_prologue) (aarch64_expand_epilogue, aarch64_final_eh_return_addr) (aarch64_initial_elimination_offset) (aarch64_setup_incoming_varargs): Adjust location of saved_varargs_size. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 3348cf2..c67bac4 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -2130,9 +2130,9 @@ aarch64_expand_prologue (void) rtx insn; aarch64_layout_frame (); - original_frame_size = get_frame_size () + cfun->machine->saved_varargs_size; - gcc_assert ((!cfun->machine->saved_varargs_size || cfun->stdarg) - && (cfun->stdarg || !cfun->machine->saved_varargs_size)); + original_frame_size = get_frame_size () + cfun->machine->frame.saved_varargs_size; + gcc_assert ((!cfun->machine->frame.saved_varargs_size || cfun->stdarg) + && (cfun->stdarg || !cfun->machine->frame.saved_varargs_size)); frame_size = (original_frame_size + cfun->machine->frame.saved_regs_size + crtl->outgoing_args_size); offset = frame_size = AARCH64_ROUND_UP (frame_size, @@ -2296,7 +2296,7 @@ aarch64_expand_epilogue (bool for_sibcall) rtx cfa_reg; aarch64_layout_frame (); - original_frame_size = get_frame_size () + cfun->machine->saved_varargs_size; + original_frame_size = get_frame_size () + cfun->machine->frame.saved_varargs_size; frame_size = (original_frame_size + cfun->machine->frame.saved_regs_size + crtl->outgoing_args_size); offset = frame_size = AARCH64_ROUND_UP (frame_size, @@ -2495,7 +2495,7 @@ aarch64_final_eh_return_addr (void) { HOST_WIDE_INT original_frame_size, frame_size, offset, fp_offset; aarch64_layout_frame (); - original_frame_size = get_frame_size () + cfun->machine->saved_varargs_size; + original_frame_size = get_frame_size () + cfun->machine->frame.saved_varargs_size; frame_size = (original_frame_size + cfun->machine->frame.saved_regs_size + crtl->outgoing_args_size); offset = frame_size = AARCH64_ROUND_UP (frame_size, @@ -4258,7 +4258,7 @@ aarch64_initial_elimination_offset (unsigned from, unsigned to) aarch64_layout_frame (); frame_size = (get_frame_size () + cfun->machine->frame.saved_regs_size + crtl->outgoing_args_size - + cfun->machine->saved_varargs_size); + + cfun->machine->frame.saved_varargs_size); frame_size = AARCH64_ROUND_UP (frame_size, STACK_BOUNDARY / BITS_PER_UNIT); offset = frame_size; @@ -6943,7 +6943,7 @@ aarch64_setup_incoming_varargs (cumulative_args_t cum_v, enum machine_mode mode, /* We don't save the size into *PRETEND_SIZE because we want to avoid any complication of having crtl->args.pretend_args_size changed. */ - cfun->machine->saved_varargs_size + cfun->machine->frame.saved_varargs_size = (AARCH64_ROUND_UP (gr_saved * UNITS_PER_WORD, STACK_BOUNDARY / BITS_PER_UNIT) + vr_saved * UNITS_PER_VREG); diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index ced5a5e..392d095 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -514,6 +514,13 @@ extern enum aarch64_processor aarch64_tune; struct GTY (()) aarch64_frame { HOST_WIDE_INT reg_offset[FIRST_PSEUDO_REGISTER]; + + /* The number of extra stack bytes taken up by register varargs. + This area is allocated by the callee at the very top of the + frame. This value is rounded up to a multiple of + STACK_BOUNDARY. */ + HOST_WIDE_INT saved_varargs_size; + HOST_WIDE_INT saved_regs_size; /* Padding if needed after the all the callee save registers have been saved. */ @@ -526,11 +533,6 @@ struct GTY (()) aarch64_frame typedef struct GTY (()) machine_function { struct aarch64_frame frame; - - /* The number of extra stack bytes taken up by register varargs. - This area is allocated by the callee at the very top of the frame. */ - HOST_WIDE_INT saved_varargs_size; - } machine_function; #endif -- 1.7.9.5