https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90026
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Tue Apr 30 21:02:08 2019 New Revision: 270748 URL: https://gcc.gnu.org/viewcvs?rev=270748&root=gcc&view=rev Log: Backported from mainline 2019-04-12 Jakub Jelinek <ja...@redhat.com> PR rtl-optimization/90026 * cfgcleanup.c (try_optimize_cfg): When removing empty bb with no successors, look for BARRIERs inside of the whole BB_FOOTER chain rather than just at the start of it. If e->src BB_FOOTER is not NULL in cfglayout mode, use emit_barrier_after_bb. * g++.dg/opt/pr90026.C: New test. Added: branches/gcc-8-branch/gcc/testsuite/g++.dg/opt/pr90026.C Modified: branches/gcc-8-branch/gcc/ChangeLog branches/gcc-8-branch/gcc/cfgcleanup.c branches/gcc-8-branch/gcc/testsuite/ChangeLog