https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105624
--- Comment #6 from Uroš Bizjak <ubizjak at gmail dot com> --- (In reply to rsand...@gcc.gnu.org from comment #5) > FWIW, I think the problem is specific to operands that are > commutative with a non-constant operand. For example, > suppose the pre-RA instruction had a pseudo register R matching > a register_operand and a constant C matching a const_int_operand. > If R does not get allocated, and so gets replaced by a stack slot M, > the % would allow the RA to try mapping C to the register_operand > and M to the const_int_operand. Without a constraint on the latter, > the M mapping would seem to be valid, and reloading C into a register > might seem less costly than reloading M into a register. > > The intent of the patch seemed good otherwise (and a nice clean-up). > I don't think the whole thing needed to be reverted. I was afraid I don't understood the reason of the failure well, although it happened very rarely (actually, no failures were detected during the build or testsuite run). The patch obviously triggered some inconsistency in the infrastructure, so without some assurances, I took the safe way and reverted everything. I would gladly revert the revert. The reload is just doing unnecessary work when multiple constraints are the same; all necessary information could be retreived from the predicate.