https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106450
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Roger Sayle <sa...@gcc.gnu.org>: https://gcc.gnu.org/g:493f4e6cf081ea2d016547629b29d130c1533ccb commit r13-1906-g493f4e6cf081ea2d016547629b29d130c1533ccb Author: Roger Sayle <ro...@nextmovesoftware.com> Date: Sun Jul 31 21:44:51 2022 +0100 PR target/106450: Tweak timode_remove_non_convertible_regs on x86_64. This patch resolves PR target/106450, some more fall-out from more aggressive TImode scalar-to-vector (STV) optimizations. I continue to be caught out by how far TImode STV has diverged from DImode/SImode STV, and therefore requires additional (unexpected) tweaking. Many thanks to H.J. Lu for pointing out timode_remove_non_convertible_regs needs to be extended to handle XOR (and other new operations). Unhelpfully the comment above this function states that it's the TImode version of "remove_non_convertible_regs", which doesn't exist anymore, so I've resurrected an explanatory comment from the git history. By refactoring the checks for hard regs and already "marked" regs into timode_check_non_convertible_regs itself, all of its callers are simplified. This patch then FOR_EACH_INSN_USE and FOR_EACH_INSN_DEF to generically handle arbitrary (non-move) instructions (including unary and binary operations), calling timode_check_non_convertible_regs on each TImode register USE and DEF. 2022-07-31 Roger Sayle <ro...@nextmovesoftware.com> H.J. Lu <hjl.to...@gmail.com> gcc/ChangeLog PR target/106450 * config/i386/i386-features.cc (timode_check_non_convertible_regs): Do nothing if REGNO is set in the REGS bitmap, or is a hard reg. (timode_remove_non_convertible_regs): Update comment. Call timode_check_non_convertible_reg on all TImode register DEFs and USEs in each instruction. gcc/testsuite/ChangeLog PR target/106450 * gcc.target/i386/pr106450.c: New test case.