https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101260
--- Comment #17 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Andreas Krebbel <kreb...@gcc.gnu.org>: https://gcc.gnu.org/g:b9ebf6c330e24e886e7ce148e8c680c3e06c24dc commit r12-6960-gb9ebf6c330e24e886e7ce148e8c680c3e06c24dc Author: Andreas Krebbel <kreb...@linux.ibm.com> Date: Tue Feb 1 13:33:55 2022 +0100 PR101260 regcprop: Add mode change check for copy reg When propagating a multi-word register into an access with a smaller mode the can_change_mode backend hook is already consulted for the original register. This however is also required for the intermediate copy in copy_regno which might use a different register class. gcc/ChangeLog: PR rtl-optimization/101260 * regcprop.cc (maybe_mode_change): Invoke mode_change_ok also for copy_regno. gcc/testsuite/ChangeLog: PR rtl-optimization/101260 * gcc.target/s390/pr101260.c: New testcase.