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 Sat, Nov 13, 2004 at 11:47:45PM -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))));
> +	}
> +      break;
> +    default:
> +      break;
> +      
> +    }
> +  if (new)
> +    {
> +      x = gen_lowpart (mode, new);
> +      code = GET_CODE (x);
> +    }
> +  
> +  /* Now recursively process each operand of this operation.  */
> +  fmt = GET_RTX_FORMAT (code);
> +  for (i = 0; i < GET_RTX_LENGTH (code); i++)
> +    if (fmt[i] == 'e')
> +      {
> +	new = canon_for_address (XEXP (x, i));
> +	XEXP (x, i) = new;
> +      }
> +  return x;

Think about the path through this function via ashift and tell me 
what two unnecessary bits of work you see.


r~


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