From patchwork Wed Jan 14 05:13:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 428779 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 E6C46140297 for ; Wed, 14 Jan 2015 16:15:07 +1100 (AEDT) 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=clRa2ui8rP/lwJYxXanRt+isYOscLL9jk8mWuyfcBC9ieZvnYXxAg CwWMkf/6NcQEiEkrgQ3DmaeokMddvBvroMbWi9aX/0Du2bXBJ33OV3geYCcfq4aG Yu+ZwuymkTOroCa0njPyT6ui9bugzQvo6TRS3gAuHfeLtN525cQW/c= 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=V8olrrleSd5D0//cXsv/XHlcZec=; b=KkdSKuiM9GCcvBNT6pQU Trteyi7O9FhF0LpdBwk12PRYxg1TTmFDWuFlWoht3DfTVd6XqCSYmDcuXVJ8BfQ9 xr0VzJmWvjTksyOVbxHf6lwtH6BEy3G8G1Onan49ltZiJThh9IsIaycZTJniucIy 9lffh0w9KuvoVDRYG5UsZgI= Received: (qmail 28319 invoked by alias); 14 Jan 2015 05:14:38 -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 28252 invoked by uid 89); 14 Jan 2015 05:14:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 14 Jan 2015 05:13:55 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 9A41A540B43; Wed, 14 Jan 2015 06:13:50 +0100 (CET) Date: Wed, 14 Jan 2015 06:13:50 +0100 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Drop workaround for old binutils linker plugin bug Message-ID: <20150114051350.GD13412@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Hi, this workaround actually triggers bug in quite recent golds, so it seems to be good motivation to finally drop it. The bug is long fixed. Bootstrapped/regtested x86_64-linux, will commit it shortly. Honza * tree-profile.c (init_ic_make_global_vars): Drop workaround for bintuils bug 14342. (init_ic_make_global_vars): Likewise. (gimple_init_edge_profiler): Likewise. (gimple_gen_ic_func_profiler): Likewise. Index: tree-profile.c =================================================================== --- tree-profile.c (revision 219571) +++ tree-profile.c (working copy) @@ -105,30 +105,15 @@ init_ic_make_global_vars (void) ptr_void = build_pointer_type (void_type_node); - /* Workaround for binutils bug 14342. Once it is fixed, remove lto path. */ - if (flag_lto) - { - ic_void_ptr_var - = build_decl (UNKNOWN_LOCATION, VAR_DECL, - get_identifier ("__gcov_indirect_call_callee_ltopriv"), - ptr_void); - TREE_PUBLIC (ic_void_ptr_var) = 1; - DECL_COMMON (ic_void_ptr_var) = 1; - DECL_VISIBILITY (ic_void_ptr_var) = VISIBILITY_HIDDEN; - DECL_VISIBILITY_SPECIFIED (ic_void_ptr_var) = true; - } - else - { - ic_void_ptr_var - = build_decl (UNKNOWN_LOCATION, VAR_DECL, - get_identifier ( - (PARAM_VALUE (PARAM_INDIR_CALL_TOPN_PROFILE) ? - "__gcov_indirect_call_topn_callee" : - "__gcov_indirect_call_callee")), - ptr_void); - TREE_PUBLIC (ic_void_ptr_var) = 1; - DECL_EXTERNAL (ic_void_ptr_var) = 1; - } + ic_void_ptr_var + = build_decl (UNKNOWN_LOCATION, VAR_DECL, + get_identifier ( + (PARAM_VALUE (PARAM_INDIR_CALL_TOPN_PROFILE) ? + "__gcov_indirect_call_topn_callee" : + "__gcov_indirect_call_callee")), + ptr_void); + TREE_PUBLIC (ic_void_ptr_var) = 1; + DECL_EXTERNAL (ic_void_ptr_var) = 1; TREE_STATIC (ic_void_ptr_var) = 1; DECL_ARTIFICIAL (ic_void_ptr_var) = 1; DECL_INITIAL (ic_void_ptr_var) = NULL; @@ -138,30 +123,16 @@ init_ic_make_global_vars (void) varpool_node::finalize_decl (ic_void_ptr_var); gcov_type_ptr = build_pointer_type (get_gcov_type ()); - /* Workaround for binutils bug 14342. Once it is fixed, remove lto path. */ - if (flag_lto) - { - ic_gcov_type_ptr_var - = build_decl (UNKNOWN_LOCATION, VAR_DECL, - get_identifier ("__gcov_indirect_call_counters_ltopriv"), - gcov_type_ptr); - TREE_PUBLIC (ic_gcov_type_ptr_var) = 1; - DECL_COMMON (ic_gcov_type_ptr_var) = 1; - DECL_VISIBILITY (ic_gcov_type_ptr_var) = VISIBILITY_HIDDEN; - DECL_VISIBILITY_SPECIFIED (ic_gcov_type_ptr_var) = true; - } - else - { - ic_gcov_type_ptr_var - = build_decl (UNKNOWN_LOCATION, VAR_DECL, - get_identifier ( - (PARAM_VALUE (PARAM_INDIR_CALL_TOPN_PROFILE) ? - "__gcov_indirect_call_topn_counters" : - "__gcov_indirect_call_counters")), - gcov_type_ptr); - TREE_PUBLIC (ic_gcov_type_ptr_var) = 1; - DECL_EXTERNAL (ic_gcov_type_ptr_var) = 1; - } + + ic_gcov_type_ptr_var + = build_decl (UNKNOWN_LOCATION, VAR_DECL, + get_identifier ( + (PARAM_VALUE (PARAM_INDIR_CALL_TOPN_PROFILE) ? + "__gcov_indirect_call_topn_counters" : + "__gcov_indirect_call_counters")), + gcov_type_ptr); + TREE_PUBLIC (ic_gcov_type_ptr_var) = 1; + DECL_EXTERNAL (ic_gcov_type_ptr_var) = 1; TREE_STATIC (ic_gcov_type_ptr_var) = 1; DECL_ARTIFICIAL (ic_gcov_type_ptr_var) = 1; DECL_INITIAL (ic_gcov_type_ptr_var) = NULL; @@ -230,33 +201,18 @@ gimple_init_edge_profiler (void) init_ic_make_global_vars (); - /* Workaround for binutils bug 14342. Once it is fixed, remove lto path. */ - if (flag_lto) - { - /* void (*) (gcov_type, void *) */ - ic_profiler_fn_type - = build_function_type_list (void_type_node, - gcov_type_ptr, gcov_type_node, - ptr_void, ptr_void, - NULL_TREE); - tree_indirect_call_profiler_fn - = build_fn_decl ("__gcov_indirect_call_profiler", - ic_profiler_fn_type); - } - else - { - /* void (*) (gcov_type, void *) */ - ic_profiler_fn_type - = build_function_type_list (void_type_node, - gcov_type_node, - ptr_void, - NULL_TREE); - tree_indirect_call_profiler_fn - = build_fn_decl ( (PARAM_VALUE (PARAM_INDIR_CALL_TOPN_PROFILE) ? - "__gcov_indirect_call_topn_profiler": - "__gcov_indirect_call_profiler_v2"), - ic_profiler_fn_type); - } + /* void (*) (gcov_type, void *) */ + ic_profiler_fn_type + = build_function_type_list (void_type_node, + gcov_type_node, + ptr_void, + NULL_TREE); + tree_indirect_call_profiler_fn + = build_fn_decl ( (PARAM_VALUE (PARAM_INDIR_CALL_TOPN_PROFILE) ? + "__gcov_indirect_call_topn_profiler": + "__gcov_indirect_call_profiler_v2"), + ic_profiler_fn_type); + TREE_NOTHROW (tree_indirect_call_profiler_fn) = 1; DECL_ATTRIBUTES (tree_indirect_call_profiler_fn) = tree_cons (get_identifier ("leaf"), NULL, @@ -477,7 +433,8 @@ gimple_gen_ic_func_profiler (void) stmt1: __gcov_indirect_call_profiler_v2 (profile_id, ¤t_function_decl) */ - gsi = gsi_after_labels (split_edge (single_succ_edge (ENTRY_BLOCK_PTR_FOR_FN (cfun)))); + gsi = gsi_after_labels (split_edge (single_succ_edge + (ENTRY_BLOCK_PTR_FOR_FN (cfun)))); cur_func = force_gimple_operand_gsi (&gsi, build_addr (current_function_decl, @@ -485,26 +442,10 @@ gimple_gen_ic_func_profiler (void) true, NULL_TREE, true, GSI_SAME_STMT); tree_uid = build_int_cst - (gcov_type_node, cgraph_node::get (current_function_decl)->profile_id); - /* Workaround for binutils bug 14342. Once it is fixed, remove lto path. */ - if (flag_lto) - { - tree counter_ptr, ptr_var; - counter_ptr = force_gimple_operand_gsi (&gsi, ic_gcov_type_ptr_var, - true, NULL_TREE, true, - GSI_SAME_STMT); - ptr_var = force_gimple_operand_gsi (&gsi, ic_void_ptr_var, - true, NULL_TREE, true, - GSI_SAME_STMT); - - stmt1 = gimple_build_call (tree_indirect_call_profiler_fn, 4, - counter_ptr, tree_uid, cur_func, ptr_var); - } - else - { - stmt1 = gimple_build_call (tree_indirect_call_profiler_fn, 2, - tree_uid, cur_func); - } + (gcov_type_node, + cgraph_node::get (current_function_decl)->profile_id); + stmt1 = gimple_build_call (tree_indirect_call_profiler_fn, 2, + tree_uid, cur_func); gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT); /* Set __gcov_indirect_call_callee to 0,