https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91880
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-8 branch has been updated by Max Filippov <jcmvb...@gcc.gnu.org>: https://gcc.gnu.org/g:87c1bfebcdda50ff8964a07c9963823de43de65a commit r8-10181-g87c1bfebcdda50ff8964a07c9963823de43de65a Author: Max Filippov <jcmvb...@gmail.com> Date: Thu Sep 26 20:51:27 2019 +0000 xtensa: backport fix for PR target/91880 Xtensa hwloop_optimize segfaults when zero overhead loop is about to be inserted as the first instruction of the function. Insert zero overhead loop instruction into new basic block before the loop when basic block that precedes the loop is empty. 2020-04-15 Max Filippov <jcmvb...@gmail.com> gcc/ * config/xtensa/xtensa.c (hwloop_optimize): Insert zero overhead loop instruction into new basic block before the loop when basic block that precedes the loop is empty. gcc/testsuite/ * gcc.target/xtensa/pr91880.c: New test case. * gcc.target/xtensa/xtensa.exp: New test suite.