From patchwork Thu Jul 1 11:05:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Kuvyrkov X-Patchwork-Id: 57533 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 220D3B7083 for ; Thu, 1 Jul 2010 21:05:52 +1000 (EST) Received: (qmail 2158 invoked by alias); 1 Jul 2010 11:05:49 -0000 Received: (qmail 2143 invoked by uid 22791); 1 Jul 2010 11:05:48 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 01 Jul 2010 11:05:44 +0000 Received: (qmail 4629 invoked from network); 1 Jul 2010 11:05:42 -0000 Received: from unknown (HELO ?172.16.1.24?) (maxim@127.0.0.2) by mail.codesourcery.com with ESMTPA; 1 Jul 2010 11:05:42 -0000 Message-ID: <4C2C7683.4070302@codesourcery.com> Date: Thu, 01 Jul 2010 15:05:39 +0400 From: Maxim Kuvyrkov User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.4) Gecko/20100608 Thunderbird/3.1 MIME-Version: 1.0 To: Jeff Law , gcc-patches CC: Steven Bosscher Subject: 0008-Don-t-kill-generated-expressions-in-hoist_expr_reach References: <4C18F225.2040509@codesourcery.com> In-Reply-To: <4C18F225.2040509@codesourcery.com> 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 This patch fixes a quirk in hoist_expr_reaches_here_p that makes it to avoid moving an expression across its computation in another block. Bootstrapped and regtested on x86[_64]-linux-gnu and regtested on arm-linux-gnu. This change reduces PIC code size on ARM by 0.3% and doesn't increase non-PIC code size. OK to check in? diff --git a/gcc/gcse.c b/gcc/gcse.c index 47d0dba..f37e486 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -4478,9 +4478,6 @@ hoist_expr_reaches_here_p (basic_block expr_bb, int expr_index, basic_block bb, break; else if (pred_bb == expr_bb) continue; - /* Does this predecessor generate this expression? */ - else if (TEST_BIT (comp[pred_bb->index], expr_index)) - break; else if (! TEST_BIT (transp[pred_bb->index], expr_index)) break;