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: [PATCH] Fixes some of PR 18463 and 17647, i386 address mode not being generated


On Thu, Nov 25, 2004 at 03:26:59PM -0500, Andrew Pinski wrote:
> +    case ASHIFT:
> +      if (GET_CODE (XEXP (x, 1)) == CONST_INT
> +	  && INTVAL (XEXP (x, 1)) < HOST_BITS_PER_WIDE_INT
> +	  && INTVAL (XEXP (x, 1)) >= 0)
> +        {
> +	  new = canon_for_address (XEXP (x, 0));
> +	  new = gen_rtx_MULT (mode, new,
> +			      GEN_INT ((HOST_WIDE_INT) 1
> +				       << INTVAL (XEXP (x, 1))));

I think you shouldn't transform this if INTVAL is larger than
the mode.  You may say "but that would be illegal", except that
shift_truncation_mask is what actually applies after the 
backend has had its hand in.  And do use gen_int_mode.

Otherwise ok.


r~


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