From patchwork Wed Sep 29 21:56:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 66100 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 5F245B6F11 for ; Thu, 30 Sep 2010 07:56:18 +1000 (EST) Received: (qmail 17248 invoked by alias); 29 Sep 2010 21:56:16 -0000 Received: (qmail 17234 invoked by uid 22791); 29 Sep 2010 21:56:16 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from g6t0186.atlanta.hp.com (HELO g6t0186.atlanta.hp.com) (15.193.32.63) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 29 Sep 2010 21:56:12 +0000 Received: from g5t0029.atlanta.hp.com (g5t0029.atlanta.hp.com [16.228.8.141]) by g6t0186.atlanta.hp.com (Postfix) with ESMTP id 6A82C2CC86; Wed, 29 Sep 2010 21:56:10 +0000 (UTC) Received: from lucas.cup.hp.com (lucas.cup.hp.com [15.244.97.116]) by g5t0029.atlanta.hp.com (Postfix) with ESMTP id D9B34200B8; Wed, 29 Sep 2010 21:56:09 +0000 (UTC) Received: (from sje@localhost) by lucas.cup.hp.com (8.11.1 (PHNE_35485)/8.11.1) id o8TLu9M07022; Wed, 29 Sep 2010 14:56:09 -0700 (PDT) Date: Wed, 29 Sep 2010 14:56:09 -0700 (PDT) From: Steve Ellcey Message-Id: <201009292156.o8TLu9M07022@lucas.cup.hp.com> To: gcc-patches@gcc.gnu.org Subject: Patch for partial inlining/text.unlikely bug, PR tree-optimization/45781 Cc: hubicka@gcc.gnu.org Reply-to: sje@cup.hp.com 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 I have had bootstrap problems in IA64 ever since the partial inlining patch was applied (r161382). I first reported this in PR44716 and then later found that the problem was related to the fact that GCC was putting some code in .text.unlikely (instead of .text) which it never did before. This is reported in PR45781. PR45781 includes a test case for which this behaviour can be duplicated on x86 as well as IA64 and probably other platforms as well. This proposed patch changes compute_function_frequency so that if there is no branch probabilities or profile info or attributes then a function is put into the normal text segment by setting node->frequency to NODE_FREQUENCY_NORMAL instead of not setting at all. Tested on IA64 HP-UX and Linux and on x86 Linux. Does this patch seem like the right fix for this problem? OK to checkin? Steve Ellcey sje@cup.hp.com 2010-09-29 Steve Ellcey PR tree-optimization/45781 PR middle-end/44716 * predict.c: Set frequency to normal if no overrides. Index: predict.c =================================================================== --- predict.c (revision 164573) +++ predict.c (working copy) @@ -2204,6 +2204,8 @@ compute_function_frequency (void) else if (DECL_STATIC_CONSTRUCTOR (current_function_decl) || DECL_STATIC_DESTRUCTOR (current_function_decl)) node->frequency = NODE_FREQUENCY_EXECUTED_ONCE; + else + node->frequency = NODE_FREQUENCY_NORMAL; return; } node->frequency = NODE_FREQUENCY_UNLIKELY_EXECUTED;