On 3/30/20 6:26 AM, Segher Boessenkool wrote: > On Mon, Mar 30, 2020 at 09:50:05AM +0100, Richard Sandiford wrote: >> Peter Bergner via Gcc-patches <gcc-patches@gcc.gnu.org> writes: >>> - if (HARD_REGISTER_NUM_P (rd) || HARD_REGISTER_NUM_P (rs)) >>> + if (HARD_REGISTER_NUM_P (rd)) >>> return false; >>> >>> b = reg_copy_graph[rs]; >> >> I guess this would also work if we dropped the rd check instead. >> So how about s/||/&&/ instead, to avoid the assymetry? >> >> I agree something like this is a better fix long-term, since we >> shouldn't be relying on make_more_copies outside combine. > > Yes; on the other hand, most RTL passes should do something to not have > hard registers forwarded into non-move instructions (where they can > cause problems later). (make_more_copies itself is a technicality > specific to how combine works, and we might be able to drop it in the > future).
I kind of agree with Richard above on making it more applicable/symmetric, but why can't we just remove the HARD_REGISTER_NUM_P() tests altogether? It's not like lower-subreg is extending hard register lifetime usage than what is already there in the rtl. We're just decomposing what's already there into smaller register sized chunks. Is there a problem with that I'm not aware of? Peter