Hi Eric,
Note that the very same code is in expand_assignment, so they probably should be kept in sync.
Oops - I had missed that.
The patch adds a second call to expand_expr(), giving the address mode as the suggested mode, and using a normal expansion, rather than EXPAND_SUM. This might work, but even if it does not the rtl in offset_rtx will be valid in a non-address context so that whatever convert_to_mode does will still remain valid.I don't think that we want to expand twice the same expression. What about calling force_operand on offset_rtx right before convert_to_mode?
That works too, and is much better than my solution.What do you think of the attached patch ? Is it suitable for submission once the sources are out of stage 4 ? (No regressions with an x86_64-pc-linux-gnu toolchain and several fixes for an rl78-elf toolchain).
Cheers Nick
expr.c.patch.2
Description: Unix manual page