This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RFA: fix POST_MODIFY handling in rtx_equiv_p
- From: Joern RENNECKE <joern dot rennecke at st dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Dan Nicolaescu <dann at ics dot uci dot edu>
- Date: Thu, 09 Mar 2006 18:28:54 +0000
- Subject: 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);