https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100225
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Roman Zhuykov <zhr...@gcc.gnu.org>: https://gcc.gnu.org/g:4cf3b10f27b1994cf4a9eb12079d85412ebc7cad commit r12-310-g4cf3b10f27b1994cf4a9eb12079d85412ebc7cad Author: Roman Zhuykov <zhr...@ispras.ru> Date: Fri Apr 30 11:08:03 2021 +0300 modulo-sched: skip loops with strange register defs [PR100225] PR84878 fix adds an assertion which can fail, e.g. when stack pointer is adjusted inside the loop. We have to prevent it and search earlier for any 'strange' instruction. The solution is to skip the whole loop if using 'note_stores' we found that one of hard registers is in 'df->regular_block_artificial_uses' set. Also patch properly prohibit not single-set instruction in loop body. gcc/ChangeLog: PR rtl-optimization/100225 PR rtl-optimization/84878 * modulo-sched.c (sms_schedule): Use note_stores to skip loops where we have an instruction which touches (writes) any hard register from df->regular_block_artificial_uses set. Allow not-single-set instruction only right before basic block tail. gcc/testsuite/ChangeLog: PR rtl-optimization/100225 PR rtl-optimization/84878 * gcc.dg/pr100225.c: New test. libgomp/ChangeLog: * testsuite/libgomp.oacc-c-c++-common/atomic_capture-3.c: New test.