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 PR45073


We can end up folding calls before going into SSA.  Make
gimplify_and_update_call_from_tree deal with that.

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

Richard.

2010-07-26  Richard Guenther  <rguenther@suse.de>

	PR middle-end/45073
	* gimple-fold.c (gimplify_and_update_call_from_tree): Conditionalize
	SSA updating on being in SSA form.

Index: gcc/gimple-fold.c
===================================================================
*** gcc/gimple-fold.c	(revision 162536)
--- gcc/gimple-fold.c	(working copy)
*************** gimplify_and_update_call_from_tree (gimp
*** 853,860 ****
  	  gsi_next (si_p);
  	}
        new_stmt = gsi_stmt (i);
!       find_new_referenced_vars (new_stmt);
!       mark_symbols_for_renaming (new_stmt);
        /* If the new statement has a VUSE, update it with exact SSA name we
           know will reach this one.  */
        if (gimple_vuse (new_stmt))
--- 853,863 ----
  	  gsi_next (si_p);
  	}
        new_stmt = gsi_stmt (i);
!       if (gimple_in_ssa_p (cfun))
! 	{
! 	  find_new_referenced_vars (new_stmt);
! 	  mark_symbols_for_renaming (new_stmt);
! 	}
        /* If the new statement has a VUSE, update it with exact SSA name we
           know will reach this one.  */
        if (gimple_vuse (new_stmt))
*************** gimplify_and_update_call_from_tree (gimp
*** 892,898 ****
  	    SSA_NAME_DEF_STMT (gimple_vdef (stmt)) = laststore;
  	  update_stmt (laststore);
  	}
!       else
  	{
  	  unlink_stmt_vdef (stmt);
  	  release_defs (stmt);
--- 895,901 ----
  	    SSA_NAME_DEF_STMT (gimple_vdef (stmt)) = laststore;
  	  update_stmt (laststore);
  	}
!       else if (gimple_in_ssa_p (cfun))
  	{
  	  unlink_stmt_vdef (stmt);
  	  release_defs (stmt);


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