From 8fc001f9a2a7e33d30abef625c9245995dcfe9f0 Mon Sep 17 00:00:00 2001 From: Jeffrey A Law Date: Thu, 20 Aug 1998 18:45:48 +0000 Subject: [PATCH] jump.c (rtx_renumbered_equal_p): Do not consider PLUS commutative. * 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 | 4 ++++ gcc/jump.c | 17 ++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 38c02549888..5b659e31b7f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 * config/sparc/sparc.md (movtf_insn_sp32): All memory operands diff --git a/gcc/jump.c b/gcc/jump.c index dfc4ae64c3e..befd7071077 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -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))