From patchwork Thu Jul 1 11:05:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: 0008-Don-t-kill-generated-expressions-in-hoist_expr_reach Date: Thu, 01 Jul 2010 01:05:39 -0000 From: Maxim Kuvyrkov X-Patchwork-Id: 57533 Message-Id: <4C2C7683.4070302@codesourcery.com> To: Jeff Law , gcc-patches Cc: Steven Bosscher 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;