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]

Re: RFC: patch to build GCC for arm with LRA


Yvan Roux <yvan.roux@linaro.org> writes:
> @@ -5786,7 +5796,11 @@ get_index_scale (const struct address_info *info)
>        && info->index_term == &XEXP (index, 0))
>      return INTVAL (XEXP (index, 1));
>  
> -  if (GET_CODE (index) == ASHIFT
> +  if ((GET_CODE (index) == ASHIFT
> +       || GET_CODE (index) == ASHIFTRT
> +       || GET_CODE (index) == LSHIFTRT
> +       || GET_CODE (index) == ROTATE
> +       || GET_CODE (index) == ROTATERT)
>        && CONST_INT_P (XEXP (index, 1))
>        && info->index_term == &XEXP (index, 0))
>      return (HOST_WIDE_INT) 1 << INTVAL (XEXP (index, 1));

This bit doesn't look right.  The scale is only 1 << N for (ashift ... N).
I think we have to stick to returning zero for the other codes.

The other two (snipped) rtlanal.c hunks like fine to me FWIW.  Maybe now
would be a good time to add an "is this a shift code?" predicate though,
if we don't have one already.

Thanks,
Richard


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