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]

[tree-ssa] [patch]: Make self-referential ephi nodes DTRT


This fixes the problem pointed out by Jeff Law.

Bootstrapped and regtested on i686-pc-linux-gnu.

2003-11-18  Daniel Berlin  <dberlin@dberlin.org>

	* tree-ssa-pre.c (code_motion): Handle self-referential ephi's
	properly.

Index: gcc/tree-ssa-pre.c
===================================================================
--- gcc.orig/tree-ssa-pre.c	2003-11-18 16:26:12.000000000 -0500
+++ gcc/tree-ssa-pre.c	2003-11-19 01:05:02.000000000 -0500
@@ -2792,7 +2792,9 @@ code_motion (struct expr_info *ei)
 	    {
 	      tree rdef;
 	      argdef = EPHI_ARG_DEF (use, i);
-	      if (argdef
+	      if (argdef == use)
+		rdef = get_temp (use);
+	      else if (argdef
 		  && EPHI_ARG_HAS_REAL_USE (use, i)
 		  && EREF_STMT (argdef)
 		  && !EPHI_ARG_INJURED (use, i))


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