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]

RFA: fix POST_MODIFY handling in rtx_equiv_p


Dan Nicolaescu pointed out to me that I left some unreachable code in the POST_MODIFY
handling of struct-equiv.c .
I inspected the code more closely and found also that there was a mixup of indices / rvalue
values.
regression tested on i686-pc-linux-gnu X arm-elf.
2006-03-09  J"orn Rennecke <joern.rennecke@st.com>

	* struct-equiv.c (rtx_equiv_p): Fix POST_MODIFY case.

Index: struct-equiv.c
===================================================================
/usr/bin/diff -p -d -F^( -u -L struct-equiv.c	(revision 111818) -L struct-equiv.c	(working copy) .svn/text-base/struct-equiv.c.svn-base struct-equiv.c
--- struct-equiv.c	(revision 111818)
+++ struct-equiv.c	(working copy)
@@ -570,17 +570,13 @@ rtx_equiv_p (rtx *xp, rtx y, int rvalue,
 	  return false;
 	x_dest1 = XEXP (x, 0);
 	/* validate_change might have changed the destination.  Put it back
-	   so that we can do a valid source match.  */
+	   so that we can do a proper match for its role a an input.  */
 	XEXP (x, 0) = x_dest0;
-	if (!rtx_equiv_p (&XEXP (x, 1), XEXP (y, 1), 0, info))
+	if (!rtx_equiv_p (&XEXP (x, 0), XEXP (y, 0), 1, info))
 	  return false;
 	gcc_assert (x_dest1 == XEXP (x, 0));
 	/* Process source.  */
 	return rtx_equiv_p (&XEXP (x, 1), XEXP (y, 1), 1, info);
-      if (!rtx_equiv_p (&XEXP(x, 0), XEXP (y, 0), 0, info))
-	return false;
-      /* Process both subexpressions as inputs.  */
-      break;
       }
     case CLOBBER:
       gcc_assert (rvalue < 0);

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