From patchwork Sun Aug 25 15:23:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 269707 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "www.sourceware.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 000BA2C00B6 for ; Mon, 26 Aug 2013 01:23:40 +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:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=CTah7/24hwSpOwVssw6Hyk/4Os3yTza8/RK2G+oL4PXgt71wh4D5/ yKCsTDamyNUQRbXB5jEK7Tk86sui2aEJqRi88nUezJvzm2NBaWXBSh0qpJFI36Dr h1qK5AlyFaNhjl7yvE8T799x8c9tut0kbU+1uBzGsANtKR2Qb1bRJg= 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:subject:message-id:mime-version:content-type; s= default; bh=7TXhQ8tI/yHzzr8+XD0PMUA8gdM=; b=ma6aWcm7w0YRyNUEaGjB YRpcidpm0V75q/H7L+8IM2Kj5Pk02u8CrM1EgFkt8PP7BTQ7yOnbt5l1QIcxsWuR A8xAp4nnoURHF0Ss0Epj1w+AJ0nRdCXE+xcpZelLhDn23idiJDVdJafBDGw7vGZs i3W+QeY1EdKnFjsrJCjefSg= Received: (qmail 11751 invoked by alias); 25 Aug 2013 15:23:33 -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 11742 invoked by uid 89); 25 Aug 2013 15:23:33 -0000 X-Spam-SWARE-Status: No, score=-5.2 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, RP_MATCHES_RCVD autolearn=ham version=3.3.2 Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with (AES256-SHA encrypted) ESMTPS; Sun, 25 Aug 2013 15:23:32 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 7936D542F01; Sun, 25 Aug 2013 17:23:29 +0200 (CEST) Date: Sun, 25 Aug 2013 17:23:29 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org, rguenther@suse.de Subject: Stream TYPE_FINAL_P and DECL_FINAL_P to LTO Message-ID: <20130825152329.GB29339@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Hi, this patch adds code to stream DECL_FINAL_P/TYPE_FINAL_P into LTO so we can use it after the ipa-devirt code at LTO time is merged in. (http://gcc.gnu.org/ml/gcc-patches/2013-08/msg01007.html) Bootstrapped/regtested x86_64-linux, OK? Honza * lto-streamer-out.c (hash_tree): Add streaming of DECL_FINAL_P and TYPE_FINAL_P * lto/lto.c (compare_tree_sccs_1): Add TYPE_FINAL_P and DECL_FINAL_P * tree-streamer-out.c (pack_ts_decl_with_vis_value_fields): Add DECL_FINAL_P. (pack_ts_type_common_value_fields): Add TYPE_FINAL_P. * tree-streamer-in.c (unpack_ts_decl_with_vis_value_fields): Add DECL_FINAL_P. (unpack_ts_type_common_value_fields): Add TYPE_FINAL_P. Index: lto-streamer-out.c =================================================================== --- lto-streamer-out.c (revision 201974) +++ lto-streamer-out.c (working copy) @@ -798,6 +798,9 @@ hash_tree (struct streamer_tree_cache_d v); v = iterative_hash_host_wide_int (DECL_TLS_MODEL (t), v); } + if (TREE_CODE (t) == FUNCTION_DECL) + v = iterative_hash_host_wide_int (DECL_FINAL_P (t), + v); if (VAR_OR_FUNCTION_DECL_P (t)) v = iterative_hash_host_wide_int (DECL_INIT_PRIORITY (t), v); } @@ -838,7 +841,10 @@ hash_tree (struct streamer_tree_cache_d | (TYPE_USER_ALIGN (t) << 5) | (TYPE_READONLY (t) << 6), v); if (RECORD_OR_UNION_TYPE_P (t)) - v = iterative_hash_host_wide_int (TYPE_TRANSPARENT_AGGR (t), v); + { + v = iterative_hash_host_wide_int (TYPE_TRANSPARENT_AGGR (t), v); + v = iterative_hash_host_wide_int (TYPE_FINAL_P (t), v); + } else if (code == ARRAY_TYPE) v = iterative_hash_host_wide_int (TYPE_NONALIASED_COMPONENT (t), v); v = iterative_hash_host_wide_int (TYPE_PRECISION (t), v); Index: lto/lto.c =================================================================== --- lto/lto.c (revision 201974) +++ lto/lto.c (working copy) @@ -1892,6 +1892,7 @@ compare_tree_sccs_1 (tree t1, tree t2, t compare_values (DECL_DISREGARD_INLINE_LIMITS); compare_values (DECL_PURE_P); compare_values (DECL_LOOPING_CONST_OR_PURE_P); + compare_values (DECL_FINAL_P); if (DECL_BUILT_IN_CLASS (t1) != NOT_BUILT_IN) compare_values (DECL_FUNCTION_CODE); if (DECL_STATIC_DESTRUCTOR (t1)) @@ -1905,7 +1906,10 @@ compare_tree_sccs_1 (tree t1, tree t2, t compare_values (TYPE_NO_FORCE_BLK); compare_values (TYPE_NEEDS_CONSTRUCTING); if (RECORD_OR_UNION_TYPE_P (t1)) - compare_values (TYPE_TRANSPARENT_AGGR); + { + compare_values (TYPE_TRANSPARENT_AGGR); + compare_values (TYPE_FINAL_P); + } else if (code == ARRAY_TYPE) compare_values (TYPE_NONALIASED_COMPONENT); compare_values (TYPE_PACKED); Index: tree-streamer-out.c =================================================================== --- tree-streamer-out.c (revision 201974) +++ tree-streamer-out.c (working copy) @@ -242,6 +242,8 @@ pack_ts_decl_with_vis_value_fields (stru bp_pack_value (bp, DECL_TLS_MODEL (expr), 3); } + if (TREE_CODE (expr) == FUNCTION_DECL) + bp_pack_value (bp, DECL_FINAL_P (expr), 1); if (VAR_OR_FUNCTION_DECL_P (expr)) bp_pack_var_len_unsigned (bp, DECL_INIT_PRIORITY (expr)); } @@ -293,7 +295,10 @@ pack_ts_type_common_value_fields (struct bp_pack_value (bp, TYPE_NO_FORCE_BLK (expr), 1); bp_pack_value (bp, TYPE_NEEDS_CONSTRUCTING (expr), 1); if (RECORD_OR_UNION_TYPE_P (expr)) - bp_pack_value (bp, TYPE_TRANSPARENT_AGGR (expr), 1); + { + bp_pack_value (bp, TYPE_TRANSPARENT_AGGR (expr), 1); + bp_pack_value (bp, TYPE_FINAL_P (expr), 1); + } else if (TREE_CODE (expr) == ARRAY_TYPE) bp_pack_value (bp, TYPE_NONALIASED_COMPONENT (expr), 1); bp_pack_value (bp, TYPE_PACKED (expr), 1); Index: tree-streamer-in.c =================================================================== --- tree-streamer-in.c (revision 201974) +++ tree-streamer-in.c (working copy) @@ -275,6 +275,8 @@ unpack_ts_decl_with_vis_value_fields (st DECL_TLS_MODEL (expr) = (enum tls_model) bp_unpack_value (bp, 3); } + if (TREE_CODE (expr) == FUNCTION_DECL) + DECL_FINAL_P (expr) = (unsigned) bp_unpack_value (bp, 1); if (VAR_OR_FUNCTION_DECL_P (expr)) { priority_type p; @@ -346,7 +348,10 @@ unpack_ts_type_common_value_fields (stru TYPE_NO_FORCE_BLK (expr) = (unsigned) bp_unpack_value (bp, 1); TYPE_NEEDS_CONSTRUCTING (expr) = (unsigned) bp_unpack_value (bp, 1); if (RECORD_OR_UNION_TYPE_P (expr)) - TYPE_TRANSPARENT_AGGR (expr) = (unsigned) bp_unpack_value (bp, 1); + { + TYPE_TRANSPARENT_AGGR (expr) = (unsigned) bp_unpack_value (bp, 1); + TYPE_FINAL_P (expr) = (unsigned) bp_unpack_value (bp, 1); + } else if (TREE_CODE (expr) == ARRAY_TYPE) TYPE_NONALIASED_COMPONENT (expr) = (unsigned) bp_unpack_value (bp, 1); TYPE_PACKED (expr) = (unsigned) bp_unpack_value (bp, 1);