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]

[PATCH] Fix PR39940, wrong types with PRE


This fixes an oversight with the redundant PHI elimination code
in PRE.  This is (one?) problem that breaks bootstrap on *-darwin9
hosts during libjava builds.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.

Richard.

2009-05-02  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/39940
	* tree-ssa-pre.c (eliminate): Make sure we may propagate before
	doing so.

Index: gcc/tree-ssa-pre.c
===================================================================
*** gcc/tree-ssa-pre.c	(revision 147054)
--- gcc/tree-ssa-pre.c	(working copy)
*************** eliminate (void)
*** 4215,4221 ****
        /* If there is a single use only, propagate the equivalency
  	 instead of keeping the copy.  */
        if (TREE_CODE (lhs) == SSA_NAME
! 	  && single_imm_use (lhs, &use_p, &use_stmt))
  	{
  	  SET_USE (use_p, gimple_assign_rhs1 (stmt));
  	  update_stmt (use_stmt);
--- 4215,4223 ----
        /* If there is a single use only, propagate the equivalency
  	 instead of keeping the copy.  */
        if (TREE_CODE (lhs) == SSA_NAME
! 	  && single_imm_use (lhs, &use_p, &use_stmt)
! 	  && may_propagate_copy (USE_FROM_PTR (use_p),
! 				 gimple_assign_rhs1 (stmt)))
  	{
  	  SET_USE (use_p, gimple_assign_rhs1 (stmt));
  	  update_stmt (use_stmt);


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