From patchwork Tue Jul 26 19:48:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xinliang David Li X-Patchwork-Id: 106930 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 177D7B6F87 for ; Wed, 27 Jul 2011 05:49:18 +1000 (EST) Received: (qmail 29169 invoked by alias); 26 Jul 2011 19:49:16 -0000 Received: (qmail 29161 invoked by uid 22791); 26 Jul 2011 19:49:15 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 26 Jul 2011 19:48:48 +0000 Received: from kpbe18.cbf.corp.google.com (kpbe18.cbf.corp.google.com [172.25.105.82]) by smtp-out.google.com with ESMTP id p6QJmjta028547; Tue, 26 Jul 2011 12:48:46 -0700 Received: from aples.mtv.corp.google.com (aples.mtv.corp.google.com [172.18.110.227]) by kpbe18.cbf.corp.google.com with ESMTP id p6QJmiNt019307; Tue, 26 Jul 2011 12:48:44 -0700 Received: by aples.mtv.corp.google.com (Postfix, from userid 74076) id 2E6FC1B40A9; Tue, 26 Jul 2011 12:48:43 -0700 (PDT) To: reply@codereview.appspotmail.com, gcc-patches@gcc.gnu.org Subject: [google] Fix lipo regression test failures after merge from trunk (issue4806053) Message-Id: <20110726194844.2E6FC1B40A9@aples.mtv.corp.google.com> Date: Tue, 26 Jul 2011 12:48:43 -0700 (PDT) From: davidxl@google.com (David Li) X-System-Of-Record: true X-IsSubscribed: yes 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 The patch is committed to google/main to fix lipo test regressions after trunk merge. 2011-07-26 David Li * value-prof.c (gimple_value_profile_transformations): Remove redundant code. * cgraphunit.c (cgraph_mark_functions_to_output): Fix assertion in lipo mode. * ipa-inline.c (early_inliner): Check fake edge. * l-ipo.c (pop_module_scope): Process alias node. (cgraph_unify_type_alias_sets): Skip empty function. * testsuite/gcc.dg/tree-prof/lipo/val-prof-2_0.c: update test case --- This patch is available for review at http://codereview.appspot.com/4806053 Index: value-prof.c =================================================================== --- value-prof.c (revision 176763) +++ value-prof.c (working copy) @@ -613,18 +613,7 @@ gimple_value_profile_transformations (vo } if (changed) - { - counts_to_freqs (); - /* Value profile transformations may change inline parameters - a lot (e.g., indirect call promotion introduces new direct calls). - The update is also needed to avoid compiler ICE -- when MULTI - target icall promotion happens, the caller's size may become - negative when the promoted direct calls get promoted. */ - /* Guard this for LIPO for now. */ - if (L_IPO_COMP_MODE) - compute_inline_parameters (cgraph_get_node (current_function_decl), - false); - } + counts_to_freqs (); return changed; } Index: cgraphunit.c =================================================================== --- cgraphunit.c (revision 176763) +++ cgraphunit.c (working copy) @@ -1531,7 +1531,8 @@ cgraph_mark_functions_to_output (void) gcc_assert (node->global.inlined_to || !gimple_has_body_p (decl) || node->in_other_partition - || DECL_EXTERNAL (decl)); + || DECL_EXTERNAL (decl) + || cgraph_is_auxiliary (node->decl)); } Index: testsuite/gcc.dg/tree-prof/lipo/val-prof-2_0.c =================================================================== --- testsuite/gcc.dg/tree-prof/lipo/val-prof-2_0.c (revision 176763) +++ testsuite/gcc.dg/tree-prof/lipo/val-prof-2_0.c (working copy) @@ -26,7 +26,7 @@ main () /* { dg-final-use { scan-ipa-dump "Mod power of 2 transformation on insn" "profile" } } */ /* This is part of code checking that n is power of 2, so we are sure that the transformation didn't get optimized out. */ -/* { dg-final-use { scan-tree-dump "n_\[0-9\]* \\+ 0xffff" "optimized"} } */ +/* { dg-final-use { scan-tree-dump "n_\[0-9\]* \\+ (4294967295|0x0*ffffffff)" "optimized"} } */ /* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */ /* { dg-final-use { cleanup-tree-dump "optimized" } } */ /* { dg-final-use { cleanup-ipa-dump "profile" } } */ Index: ipa-inline.c =================================================================== --- ipa-inline.c (revision 176763) +++ ipa-inline.c (working copy) @@ -2008,6 +2008,9 @@ early_inliner (void) for (edge = node->callees; edge; edge = edge->next_callee) { struct inline_edge_summary *es = inline_edge_summary (edge); + + if (!edge->call_stmt) + continue; es->call_stmt_size = estimate_num_insns (edge->call_stmt, &eni_size_weights); es->call_stmt_time Index: l-ipo.c =================================================================== --- l-ipo.c (revision 176763) +++ l-ipo.c (working copy) @@ -390,6 +390,7 @@ pop_module_scope (void) primary_module_last_loc = input_location; at_eof = 1; + cgraph_process_same_body_aliases (); lang_hooks.l_ipo.process_pending_decls (input_location); lang_hooks.l_ipo.clear_deferred_fns (); at_eof = 0; @@ -1067,7 +1068,8 @@ cgraph_unify_type_alias_sets (void) { push_cfun (DECL_STRUCT_FUNCTION (node->decl)); current_function_decl = node->decl; - cgraph_collect_type_referenced (); + if (gimple_has_body_p (current_function_decl)) + cgraph_collect_type_referenced (); current_function_decl = NULL; pop_cfun (); }