On 24 October 2013 07:59, DJ Delorie <d...@redhat.com> wrote: > In the past, if I use a register class that excludes the second half > of register pairs, it can't do anything because it requires both parts > of the register pair to be in the class (example: in_hard_reg_set_p > checks this). > > Which way is the "right" way?
IMHO, the documented way. We don't want an explosion of mode-dependent register classes. find_valid_class_1 is used only from a single place, where a SYMBOL_REF is reloaded, and the mode that the register is required to be valid in is the mode of the SYMBOL_REF. So the problem will only show up for targets where a SYMBOL_REF takes more than one hard register. I think the way to fix this is to change the inner loop of find_valid_class_1 to increment regno by HARD_REGNO_NREGS [regno, mode] .