This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] fixing typo in expr.c to allow proper recognition of complex addresses in some arches.
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Igor Shevlyakov <igor at shevlyakov dot com>
- Date: Fri, 25 Oct 2013 10:39:24 +0200
- Subject: Re: [PATCH] fixing typo in expr.c to allow proper recognition of complex addresses in some arches.
- Authentication-results: sourceware.org; auth=none
- References: <CAB=oy59_ccY+ow8u3jmz3tZGjUwa+mR1PyNJf=-GYaj3UOM1aw at mail dot gmail dot com> <5269FD30 dot 9050107 at redhat dot com>
> 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)))
= 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.