This is the mail archive of the
mailing list for the GCC project.
Re: [patch] tree-ssa-dom.c: Call update_stmt_if_modified beforeupdate_ssa.
- From: Jeffrey A Law <law at redhat dot com>
- To: Kazu Hirata <kazu at cs dot umass dot edu>
- Cc: gcc-patches at gcc dot gnu dot org, amacleod at redhat dot com, dnovillo at redhat dot com
- Date: Fri, 27 May 2005 00:41:27 -0600
- Subject: Re: [patch] tree-ssa-dom.c: Call update_stmt_if_modified beforeupdate_ssa.
- References: <email@example.com>
- Reply-to: law at redhat dot com
On Thu, 2005-05-26 at 18:09 -0400, Kazu Hirata wrote:
> Attached is a patch to call update_stmt_if_modified before update_ssa.
> While staring at tree_ssa_dominator_optimize, I noticed that we are
> calling update_stmt_if_modified after calling update_ssa, which
> doesn't make sense because update_ssa expects the operand cache to be
> up-to-date. (Note that update_ssa and its subroutines use things like
> SET_USE, SET_DEF, and FOR_EACH_IMM_USE_FAST.)
> The patch fixes this oddity by calling update_stmt_if_modified before
> calling update_ssa. For safety, I added to update_ssa assertion
> gcc_assert (!stmt_modified_p (stmt));
> to prevent update_ssa from proceeding with out-of-date operand cache.
> I tried to come up with a testcase such that without this patch, the
> testcase results in wrong code, but I wasn't able to. Without this
> patch, only 0.3% of statements are marked as modified where we call
> Tested on i686-pc-linux-gnu. OK to apply?
> Kazu Hirata
> 2005-05-26 Kazu Hirata <firstname.lastname@example.org>
> * tree-into-ssa.c (update_ssa): Ensure that the operand cache
> is up-to-date.
> * tree-ssa-dom.c (tree_ssa_dominator_optimize): Call
> update_stmt_if_modified before calling update_ssa.
This is fine. Please install.