On 27/06/13 17:32, Vladimir Makarov wrote:
On 06/27/2013 12:15 PM, Richard Sandiford wrote:
Vladimir Makarov <vmaka...@redhat.com> writes:
Richard, is it ok to commit to the trunk?
Looks good to me, but I gave up the right to approve it.  I think you
need ROTATERT too though (see arm_legitimate_index_p).

Also, sorry for the nitpick, but once the full condition overflows one line,
I think each == test should be on its own line.


Thanks for the comments.  Here is the new version of the patch:

2013-06-27  Vladimir Makarov  <vmaka...@redhat.com>

         * rtlanal.c (must_be_index_p, set_address_index): Add ASHIFTRT,
         LSHIFTRT, and ROTATERT.


Although it's not needed for ARM, why would you leave out ROTATE?

Hmm, on second thoughts ROTATERT immediate is always canonicalized to ROTATE (Pmode-size - imm), so it might be needed on ARM too.

R.


arm2.patch


Index: rtlanal.c
===================================================================
--- rtlanal.c   (revision 200174)
+++ rtlanal.c   (working copy)
@@ -5480,7 +5480,11 @@ must_be_base_p (rtx x)
  static bool
  must_be_index_p (rtx x)
  {
-  return GET_CODE (x) == MULT || GET_CODE (x) == ASHIFT;
+  return (GET_CODE (x) == MULT
+         || GET_CODE (x) == ASHIFT
+         || GET_CODE (x) == ASHIFTRT
+         || GET_CODE (x) == LSHIFTRT
+         || GET_CODE (x) == ROTATERT);
  }

  /* Set the segment part of address INFO to LOC, given that INNER is the
@@ -5519,7 +5523,11 @@ set_address_base (struct address_info *i
  static void
  set_address_index (struct address_info *info, rtx *loc, rtx *inner)
  {
-  if ((GET_CODE (*inner) == MULT || GET_CODE (*inner) == ASHIFT)
+  if ((GET_CODE (*inner) == MULT
+       || GET_CODE (*inner) == ASHIFT
+       || GET_CODE (*inner) == ASHIFTRT
+       || GET_CODE (*inner) == LSHIFTRT
+       || GET_CODE (*inner) == ROTATERT)
        && CONSTANT_P (XEXP (*inner, 1)))
      inner = strip_address_mutations (&XEXP (*inner, 0));
    gcc_checking_assert (REG_P (*inner)



Reply via email to