This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] pa_commutative_p refinement
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 10 Jul 2005 13:18:20 -0400 (EDT)
- Subject: [committed] pa_commutative_p refinement
PLUS is commutative when TARGET_NO_SPACE_REGS is true. In this case,
the space registers sr4 through sr7 all refer to the same space. Thus,
it doesn't matter whether the base or index register is used for space
register selection. Of course, PLUS is not commutative in patterns that
use pre or post increment.
Tested on hppa-unknown-linux-gnu with no regressions. The default
for TARGET_NO_SPACE_REGS is true on this target.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
2005-07-10 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* pa.c (pa_commutative_p): Make PLUS commutative when
TARGET_NO_SPACE_REGS is true.
Index: config/pa/pa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa.c,v
retrieving revision 1.301
diff -u -3 -p -r1.301 pa.c
--- config/pa/pa.c 7 Jul 2005 11:47:46 -0000 1.301
+++ config/pa/pa.c 10 Jul 2005 16:26:10 -0000
@@ -7831,7 +7831,8 @@ static bool
pa_commutative_p (rtx x, int outer_code)
{
return (COMMUTATIVE_P (x)
- && ((outer_code != UNKNOWN && outer_code != MEM)
+ && (TARGET_NO_SPACE_REGS
+ || (outer_code != UNKNOWN && outer_code != MEM)
|| GET_CODE (x) != PLUS));
}