Hi, The attached patch generalizes the move insn displacement calculations a little bit. Before, the same address rebasing code was present in sh_legitimize_address as well as sh_legitimize_reload_address. I've pulled those out into a separate function as a preparation step for adding HImode displacement addressing support. Tested by doing 'make all' (c,c++), compiling newlib and by making sure that for the following variants the CSiBE set code size did not change: -m2a-single -mb -O2, -m2a-single -mb -Os, -m4a-single -mb -O2, -m4a-single -mb -Os, -m4a-single -ml -O2, -m4a-single -ml -Os, -m4-single -mb -O2, -m4-single -mb -Os, -m4-single -ml -O2, -m4-single -ml -Os I'm now also running the usual reg tests on sh-sim, just in case. Other than that, OK? Cheers, Oleg ChangeLog: PR target/50751 * config/sh/sh.c (sh_legitimize_address, sh_legitimize_reload_address): Rearrange conditional logic. Move displacement address calculations to ... (sh_find_mov_disp_adjust): ... this new function.