From patchwork Mon Sep 5 09:10:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 113328 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 8F597B6F68 for ; Mon, 5 Sep 2011 19:11:11 +1000 (EST) Received: (qmail 20602 invoked by alias); 5 Sep 2011 09:11:07 -0000 Received: (qmail 20591 invoked by uid 22791); 5 Sep 2011 09:11:06 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, TW_TM X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Sep 2011 09:10:52 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 0B4488C5DF for ; Mon, 5 Sep 2011 11:10:51 +0200 (CEST) Date: Mon, 5 Sep 2011 11:10:50 +0200 (CEST) From: Richard Guenther To: gcc-patches@gcc.gnu.org Subject: [PATCH] Make merge-blocks fold all statements propagated into Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) 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 This makes merge-blocks fold all statements that have single-arg PHI arguments propagated into them. fold_stmt_inplace does not fold calls, thus the following makes us use fold_stmt instead of fold_stmt_inplace. Bootstrap and regtest ongoing on x86_64-unknown-linux-gnu. Richard. 2011-09-05 Richard Guenther * tree-cfg.c (replace_uses_by): Use fold_stmt, not fold_stmt_inplace. Index: gcc/tree-cfg.c =================================================================== --- gcc/tree-cfg.c (revision 178523) +++ gcc/tree-cfg.c (working copy) @@ -1566,9 +1570,11 @@ replace_uses_by (tree name, tree val) if (gimple_code (stmt) != GIMPLE_PHI) { + gimple_stmt_iterator gsi = gsi_for_stmt (stmt); size_t i; - fold_stmt_inplace (stmt); + fold_stmt (&gsi); + stmt = gsi_stmt (gsi); if (cfgcleanup_altered_bbs && !is_gimple_debug (stmt)) bitmap_set_bit (cfgcleanup_altered_bbs, gimple_bb (stmt)->index);