https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80158
--- Comment #16 from Bill Schmidt <wschmidt at gcc dot gnu.org> --- Ah, that's not it at all. This is much more subtle. This has to do with candidates that have alternate interpretations (as either a CAND_ADD or a CAND_MULT). We fix up the candidate that we replace, but not the alternate interpretation, if any. In this case the alternate interpretation is used as a basis for another chain of expressions, and we run into trouble. Should not be too hard to fix.