https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90026
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Fri Apr 12 07:27:25 2019 New Revision: 270304 URL: https://gcc.gnu.org/viewcvs?rev=270304&root=gcc&view=rev Log: 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: trunk/gcc/testsuite/g++.dg/opt/pr90026.C Modified: trunk/gcc/ChangeLog trunk/gcc/cfgcleanup.c trunk/gcc/testsuite/ChangeLog