But it's nothing to do with construction inside
memory_address_addr_space but with validity of an address construct.
first thing memory_address_addr_space does is deconstructing
address_mode from as parameter. But if one doesn't pass actual mode
there's not way to find it and call to legitimate_address_p hook will
fail.

On Fri, Oct 25, 2013 at 1:39 AM, Eric Botcazou <ebotca...@adacore.com> wrote:
>> Thanks.  Installed on the trunk.
>
> Well, no, that will be problematic for some architectures.  The history of
> this piece of code is complicated and it's admittedly lacking a comment, but
> the purpose of the block is clear enough:
>
>         op0 = expand_expr (base, NULL_RTX, VOIDmode, EXPAND_SUM);
>         op0 = memory_address_addr_space (address_mode, op0, as);
>         if (!integer_zerop (TREE_OPERAND (exp, 1)))
>           {
>             rtx off
>               = immed_double_int_const (mem_ref_offset (exp), address_mode);
>             op0 = simplify_gen_binary (PLUS, address_mode, op0, off);
>           }
>         op0 = memory_address_addr_space (mode, op0, as);
>
> The offset computation is done in address_mode and then, only at the end,
> converted to mode.
>
> --
> Eric Botcazou

Reply via email to