On 1/14/2026 6:55 AM, Stefan Schulze Frielinghaus wrote:
From: Stefan Schulze Frielinghaus <[email protected]>

I have put the check into cant_combine_insn_p().  However, I still
haven't convinced myself that this is a full fledged solution.  Even the
current behaviour for constraints associated a single register class
seems like only partially solved to me.  For the current case it would
solve the problem because we are substituting into a reg-reg move.
However, my current understanding is that I could actually make use of
hard registers in arbitrary patterns which wouldn't be dealt with.

With this patch I'm conservative when hard register constraints are
involved and skip any combination.

In light of not having real world examples were it breaks also for
constraints associated a single register class and being in stage 4, I'm
limiting this to hard register constraints for now.

@Jeff ok for mainline assuming that bootstrap and regtest are successful
for x86_64 and s390?
Yes, OK.

combine hasn't typically wanted or needed to look at constraints or special case pseudos with the exception of what started as register classes with a single hard register.   Initially we triggered on SMALL_REGISTER_CLASSES, then had to generalize that though the years.

The most common problem was the copy from the hard reg to the pseudo after a CALL_INSN, but on other targets, cases more complex than simple copies arise.   So there's certainly been more awareness of the copy problem, the solution is supposed to work in other contexts as well.

Jeff

Reply via email to