Aurelien Buhrig <aurelien.buhrig.gcc@xxxxxxxxx> writes: > I'm trying to implement TARGET_SECONDARY_RELOAD but I cannot make it > work properly. > The hook seems to work for preventing from moving from BASE_REG to > BASE_REG in HImode by inserting a GENERAL_REG. > But I also want to insert a GENERAL_REGS intermediate register when > moving between BASE_REGS registers and memory in HImode. > > So I wrote something like that in my TARGET_SECONDARY_RELOAD: > if (MEM_P(x) && (reload_mode == HImode) && reload_class == BASE_REGS) > return GENERAL_REGS; > > > But it seems this do not work. For instance with DI function parameter > access (movdi reg:DI <-- m) which are (automatically) split into movhi > subreg:HI <-- m; then in movhi reg:HI <- m. But the hook do not seem > to work since the reg:HI is reloaded into a BASE_REG... > > So when is this hook called? Is there something specific with spliting > insn? Or just a general thing about TARGET_SECONDARY_RELOAD I missed ? The hook is called during reload, which is run as part of register allocation. When are you splitting the DImode load? Ian