https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128690
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by hongtao Liu <[email protected]>: https://gcc.gnu.org/g:535e0759e5b7153470d4d2bf91c8d1a04747948f commit r17-6380-g535e0759e5b7153470d4d2bf91c8d1a04747948f Author: liuhongt <[email protected]> Date: Mon Nov 16 21:51:26 2026 -0800 x86_cse: Drop REG_EQUAL/REG_EQUIV notes on constant integer loads [PR128690] When replace_vector_const converts a CONST_VECTOR load no larger than an integer register into a constant integer load, it rewrites the destination with gen_lowpart. For (set (subreg:V2QI (reg:HI 126) 0) (plus:V2QI ...)) with a REG_EQUAL (const_vector:V2QI [5 5]) note, the result is (set (reg:HI 126) (const_int 1285)) with the V2QImode REG_EQUAL note left in place. Since the destination is now a bare REG, IRA records the note as an equivalence of the HImode pseudo. The CONST_VECTOR isn't a legitimate HImode constant, so IRA calls force_const_mem (HImode, const_vector:V2QI), which creates a constant pool entry whose mode doesn't match its constant. When LRA spills the pseudo and uses that equivalence, optimize_constant_pool hits the mode check in native_encode_rtx. The SET_SRC is now the constant itself, so the note is redundant. Remove REG_EQUAL and REG_EQUIV notes when the source is replaced with a CONST_INT. IRA still records the equivalence from the CONST_INT source. gcc/ChangeLog: PR target/128690 * config/i386/i386-features.cc (replace_vector_const): Remove REG_EQUAL and REG_EQUIV notes when replacing the source with a CONST_INT. gcc/testsuite/ChangeLog: PR target/128690 * gcc.target/i386/pr128690.c: New test.
