jump.c (rtx_renumbered_equal_p): Do not consider PLUS commutative.
authorJeffrey A Law <law@cygnus.com>
Thu, 20 Aug 1998 18:45:48 +0000 (18:45 +0000)
committerJeff Law <law@gcc.gnu.org>
Thu, 20 Aug 1998 18:45:48 +0000 (12:45 -0600)
        * jump.c (rtx_renumbered_equal_p): Do not consider PLUS commutative.
Because it isn't inside a MEM on the PA.  Fixes 930628-1.c on the mainline
branch.

From-SVN: r21886

gcc/ChangeLog
gcc/jump.c

index 38c0254988879143dd852f8a36a100c4f954699b..5b659e31b7fb8f123cc127cbdf3cbfb762d7696a 100644 (file)
@@ -1,3 +1,7 @@
+Thu Aug 20 19:43:44 1998  Jeffrey A Law  (law@cygnus.com)
+
+       * jump.c (rtx_renumbered_equal_p): Do not consider PLUS commutative.
+
 Thu Aug 20 17:35:20 1998  David S. Miller  <davem@pierdol.cobaltmicro.com>
 
        * config/sparc/sparc.md (movtf_insn_sp32): All memory operands
index dfc4ae64c3e16b5fb096a18bc1f9d83e7ff5f726..befd707107752e76c79a63a137065258f878eda6 100644 (file)
@@ -4234,7 +4234,15 @@ delete_labelref_insn (insn, label, delete_this)
 /* Like rtx_equal_p except that it considers two REGs as equal
    if they renumber to the same value and considers two commutative
    operations to be the same if the order of the operands has been
-   reversed.  */
+   reversed.
+
+   ??? Addition is not commutative on the PA due to the weird implicit
+   space register selection rules for memory addresses.  Therefore, we
+   don't consider a + b == b + a.
+
+   We could/should make this test a little tighter.  Possibly only
+   disabling it on the PA via some backend macro or only disabling this
+   case when the PLUS is inside a MEM.  */
 
 int
 rtx_renumbered_equal_p (x, y)
@@ -4342,8 +4350,11 @@ rtx_renumbered_equal_p (x, y)
     return 0;
 
   /* For commutative operations, the RTX match if the operand match in any
-     order.  Also handle the simple binary and unary cases without a loop.  */
-  if (code == EQ || code == NE || GET_RTX_CLASS (code) == 'c')
+     order.  Also handle the simple binary and unary cases without a loop.
+
+     ??? Don't consider PLUS a commutative operator; see comments above.  */
+  if ((code == EQ || code == NE || GET_RTX_CLASS (code) == 'c')
+      && code != PLUS)
     return ((rtx_renumbered_equal_p (XEXP (x, 0), XEXP (y, 0))
             && rtx_renumbered_equal_p (XEXP (x, 1), XEXP (y, 1)))
            || (rtx_renumbered_equal_p (XEXP (x, 0), XEXP (y, 1))