This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] tree-ssa-dom.c: Call update_stmt_if_modified beforeupdate_ssa.


On Thu, 2005-05-26 at 18:09 -0400, Kazu Hirata wrote:
> Hi,
> 
> 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
> update_stmt_if_modified.
> 
> Tested on i686-pc-linux-gnu.  OK to apply?
> 
> Kazu Hirata
> 
> 2005-05-26  Kazu Hirata  <kazu@cs.umass.edu>
> 
> 	* 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.

Thanks,
Jeff



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]