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]

Committed, CRIS: Follow-up on PR17626


I goofed on PR17626; fixed one bug, added another.  There's no general
GCC-rule of canonicalness regarding adding a register and memory AFAICT,
so it's up to the target.  For CRIS, it's (plus reg mem); other RTX won't
be recognized.  The original testcase passes on main trunk (trigs on the
local 3.2.1-derivate), hence not committed.  I considered removing this
peephole2, but a well-placed abort says it's matching as early as in
libiberty on HEAD.  Tested cross to cris-axis-linux-gnu.

	* config/cris/cris.md (moverside, movemside): With MEM, make sure
	the address is (plus reg mem).

Index: cris.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/cris/cris.md,v
retrieving revision 1.19
diff -p -c -r1.19 cris.md
*** cris.md	23 Sep 2004 21:59:13 -0000	1.19
--- cris.md	27 Sep 2004 13:29:22 -0000
***************
*** 4904,4912 ****
    rtx otherop
      = rtx_equal_p (operands[2], operands[0]) ? operands[3] : operands[2];

!   /* Make sure we have canonical RTX so we match the insn pattern - a
!      register or MULT in the first operand, not a constant.  */
!   if (CONSTANT_P (otherop))
      {
        operands[7] = operands[1];
        operands[8] = otherop;
--- 4904,4913 ----
    rtx otherop
      = rtx_equal_p (operands[2], operands[0]) ? operands[3] : operands[2];

!   /* Make sure we have canonical RTX so we match the insn pattern -
!      not a constant in the first operand.  We also require the order
!      (plus reg mem) to match the final pattern.  */
!   if (CONSTANT_P (otherop) || MEM_P (otherop))
      {
        operands[7] = operands[1];
        operands[8] = otherop;
***************
*** 4954,4962 ****
    rtx otherop
      = rtx_equal_p (operands[2], operands[0]) ? operands[3] : operands[2];

!   /* Make sure we have canonical RTX so we match the insn pattern - a
!      register or MULT in the first operand, not a constant.  */
!   if (CONSTANT_P (otherop))
      {
        operands[7] = operands[1];
        operands[8] = otherop;
--- 4955,4964 ----
    rtx otherop
      = rtx_equal_p (operands[2], operands[0]) ? operands[3] : operands[2];

!   /* Make sure we have canonical RTX so we match the insn pattern -
!      not a constant in the first operand.  We also require the order
!      (plus reg mem) to match the final pattern.  */
!   if (CONSTANT_P (otherop) || MEM_P (otherop))
      {
        operands[7] = operands[1];
        operands[8] = otherop;

brgds, H-P


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