On Wed, Feb 19, 2020 at 3:40 AM Craig Blackmore <craig.blackm...@embecosm.com> wrote: > On 10/12/2019 18:28, Craig Blackmore wrote: > Thank you for your review. I have posted an updated patch below which I think > addresses your comments. > > Ping > > https://gcc.gnu.org/ml/gcc-patches/2019-12/msg00712.html
This looks OK. There are some minor issues. (riscv_new_address_profitable_p): New function. (TARGET_NEW_ADDRESS_PROFITABLE_P): Define. These are actually in part2, and part2 already has changelog entries for them, so these can just be dropped. + /* When optimizing for size, make uncompressible 32-bit addresses more + * expensive so that compressible 32-bit addresses are preferred. */ + if (!speed && riscv_mshorten_memrefs && mode == SImode + && !riscv_compressed_lw_address_p (addr)) + return riscv_address_insns (addr, mode, false) + 1; I think that there should be a TARGET_RVC check here, just like in the gate function for the new pass. But I also suspect that this probably doesn't matter much. > https://gcc.gnu.org/ml/gcc-patches/2019-12/msg00713.html This also looks OK to me, but adding a new target hook is something that should really wait for stage1 which should only be a few weeks away now. That will also give us more time to test the patch before it appears in a gcc release. So this is OK once stage1 opens. Jim