https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87678
--- Comment #8 from Uroš Bizjak <ubizjak at gmail dot com> --- (In reply to Segher Boessenkool from comment #7) > It's not clear to me what you would have liked it to do instead? The loads from constant memory pools always have REG_EQUAL of a relevant constant attached to the instruction. As seen from Comment #3, combine first tries to combine memory reference to a constant pool with the plus operation, but fails the combination, since subst simplifies the load from constant pool to an immediate constant. Later, combine retries the combination with the REG_EQUAL from the load, which again results in the same immediate, and again fails. I would like to propose that combine handles constant pool memory references in a different way. In the second try, it shouldn't just substitute REG_EQUAL (since avoid_costant_pool_reference will return the same immediate constant anyway), but should try to combine memory reference itself. This way, combine will return combined instruction with a memory reference to a constant pool, which is valid instruction in the x86 case. So, tl;dr version reduces to - how to convice combine to return combined instruction that refers to a constant pool in the second try instead of the same invalid combined instruction with an immediate constant.