https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118832
Jeffrey A. Law <law at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2025-02-12 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #5 from Jeffrey A. Law <law at gcc dot gnu.org> --- Inherently IRA/LRA will try to rematerialize constants, that can happen if the original pseudo holding the value does not get a physical register and we determine that rematerialization is cheaper than spilling the (constant) value into the stack. It can also happen when we move initialization of pseudos to constants when doing so reduces register pressure elsewhere (ie, undoing LICM). There's almost certaily other cases as well. The larger point is if we have a define_insn_and_split that matches during/after reload, but can not be split during/after reload, then we have a bug. It'll show up with cases like we see in this BZ with constants, but it can show up with non-constant cases as well due to other post-reload actions. So not only would I be looking at fixing expand_const_vector, but we may need to take a close look at the various pattern conditions to avoid these kinds of scenarios. If we require splitting, and splitting isn't possible after reload, then the matching pattern must not match after reload.