From patchwork Tue Oct 2 08:49:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 188429 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]) by ozlabs.org (Postfix) with SMTP id 873882C008C for ; Tue, 2 Oct 2012 18:51:51 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1349772712; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version: Content-Type:Content-Transfer-Encoding:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=iSbM6hKvKhb0o9Q+LUYyps+rKQ4=; b=ROKVRve7itZbmu+ UCiArckS8FemzwNRg9n9mgip/tv+Tb5k3EuGlR3UOFthaXF4isNxy35x5MCu14Ro q2/OVZfMsxTxLqZ6wYWG3QDxIsaLrGYuRajGZlQeB/ykZOWPUfapfZgXv7tb3/M6 OSYLTYtgH2n/MVaDUuGe9If/p1xk= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:Content-Transfer-Encoding:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=E3EibEbJeZriDHovlnm8puVs1Geh6c+Y6g3a6EKCQsxsy3ev/UqIcdp08OerYl nCY/NBmBBfS7W5kh5urFCqum1w59J8RZ67MQ8KolFZQMB0Bc0V2EnLYjiQNFoAgr 159NAlGAxeqNe8Zp8PAoNuUBm+60WmTHQR9xIkOcw2qco=; Received: (qmail 28198 invoked by alias); 2 Oct 2012 08:51:48 -0000 Received: (qmail 28179 invoked by uid 22791); 2 Oct 2012 08:51:46 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, KHOP_SPAMHAUS_DROP X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Oct 2012 08:51:41 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id C24D0290009 for ; Tue, 2 Oct 2012 10:51:51 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vwk19gW-QV2u for ; Tue, 2 Oct 2012 10:51:51 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 8F709290008 for ; Tue, 2 Oct 2012 10:51:51 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [patch] Introduce DECL_NONLOCAL_FRAME Date: Tue, 02 Oct 2012 10:49:31 +0200 Message-ID: <10723758.Eh8foA2Six@polaris> User-Agent: KMail/4.7.2 (Linux/3.1.10-1.16-desktop; KDE/4.7.2; x86_64; ; ) MIME-Version: 1.0 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 Hi, this is the seemingly non-controversial part of the FRAME splitting patch. It introduces the DECL_NONLOCAL_FRAME flag, sets it during nested function lowering and... that's pretty much it. Tested on x86_64-suse-linux, OK for mainline? 2012-10-02 Eric Botcazou * tree.h (DECL_NONLOCAL_FRAME): New macro. * tree-nested.c (get_frame_type): Set DECL_NONLOCAL_FRAME. * tree-streamer-in.c (unpack_ts_decl_common_value_fields): Stream in DECL_NONLOCAL_FRAME flag. * tree-streamer-out.c (pack_ts_decl_common_value_fields): Stream out DECL_NONLOCAL_FRAME flag. Index: tree.h =================================================================== --- tree.h (revision 191924) +++ tree.h (working copy) @@ -712,6 +712,9 @@ struct GTY(()) tree_base { SSA_NAME_IS_DEFAULT_DEF in SSA_NAME + + DECL_NONLOCAL_FRAME in + VAR_DECL */ struct GTY(()) tree_typed { @@ -3270,9 +3273,14 @@ extern void decl_fini_priority_insert (t libraries. */ #define MAX_RESERVED_INIT_PRIORITY 100 +/* In a VAR_DECL, nonzero if this is a global variable for VOPs. */ #define VAR_DECL_IS_VIRTUAL_OPERAND(NODE) \ (VAR_DECL_CHECK (NODE)->base.u.bits.saturating_flag) +/* In a VAR_DECL, nonzero if this is a non-local frame structure. */ +#define DECL_NONLOCAL_FRAME(NODE) \ + (VAR_DECL_CHECK (NODE)->base.default_def_flag) + struct GTY(()) tree_var_decl { struct tree_decl_with_vis common; }; Index: tree-streamer-out.c =================================================================== --- tree-streamer-out.c (revision 191909) +++ tree-streamer-out.c (working copy) @@ -181,6 +181,9 @@ pack_ts_decl_common_value_fields (struct bp_pack_value (bp, expr->decl_common.off_align, 8); } + if (TREE_CODE (expr) == VAR_DECL) + bp_pack_value (bp, DECL_NONLOCAL_FRAME (expr), 1); + if (TREE_CODE (expr) == RESULT_DECL || TREE_CODE (expr) == PARM_DECL || TREE_CODE (expr) == VAR_DECL) Index: tree-nested.c =================================================================== --- tree-nested.c (revision 191909) +++ tree-nested.c (working copy) @@ -235,6 +235,7 @@ get_frame_type (struct nesting_info *inf info->frame_type = type; info->frame_decl = create_tmp_var_for (info, type, "FRAME"); + DECL_NONLOCAL_FRAME (info->frame_decl) = 1; /* ??? Always make it addressable for now, since it is meant to be pointed to by the static chain pointer. This pessimizes Index: tree-streamer-in.c =================================================================== --- tree-streamer-in.c (revision 191909) +++ tree-streamer-in.c (working copy) @@ -216,6 +216,9 @@ unpack_ts_decl_common_value_fields (stru expr->decl_common.off_align = bp_unpack_value (bp, 8); } + if (TREE_CODE (expr) == VAR_DECL) + DECL_NONLOCAL_FRAME (expr) = (unsigned) bp_unpack_value (bp, 1); + if (TREE_CODE (expr) == RESULT_DECL || TREE_CODE (expr) == PARM_DECL || TREE_CODE (expr) == VAR_DECL)