The following patch is for building arm GCC with LRA. I found that ASHIFTRT and LSHIFTRT are used in address calculation for arm, e.g.
(insn 78 76 79 8 (set (reg/v:SI 153 [ offset ]) (mem:SI (plus:SI (ashiftrt:SI (reg:SI 151 [ D.6620 ]) (const_int 8 [0x8])) (reg/f:SI 183 [ MEM[(const void * const *)obj_ptr_5(D)] ])) [5 *_27+0 S4 A32])) /home/cygnus/vmakarov/build1/trunk5/gcc/libstdc++-v3/libsupc++/tinfo.h:88 197 {*arm_movsi_insn} (expr_list:REG_DEAD (reg/f:SI 183 [ MEM[(const void * const *)obj_ptr_5(D)] ]) (expr_list:REG_DEAD (reg:SI 151 [ D.6620 ]) (nil)))) The patch was successfully bootstrapped on arm-hfp. Richard, is it ok to commit to the trunk? 2013-06-27 Vladimir Makarov <vmaka...@redhat.com> * rtlanal.c (must_be_index_p, set_address_index): Add ASHIFTRT and LSHIFTRT.
Index: rtlanal.c =================================================================== --- rtlanal.c (revision 200174) +++ rtlanal.c (working copy) @@ -5480,7 +5480,8 @@ 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); } /* Set the segment part of address INFO to LOC, given that INNER is the @@ -5519,7 +5520,8 @@ 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) && CONSTANT_P (XEXP (*inner, 1))) inner = strip_address_mutations (&XEXP (*inner, 0)); gcc_checking_assert (REG_P (*inner)