This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/51513] Only partially optimizes away __builtin_unreachable switch default case


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51513

--- Comment #8 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Steven Bosscher from comment #4)
> This should be solved by allowing labels in trivially_empty_bb_p.

I tried the following, but it doesn't fix the problem.

--- cfgcleanup.c        (revision 222550)
+++ cfgcleanup.c        (working copy)
@@ -2647,7 +2647,8 @@ trivially_empty_bb_p (basic_block bb)
     {
       if (insn == BB_HEAD (bb))
        return true;
-      if (!DEBUG_INSN_P (insn))
+      if (!(DEBUG_INSN_P (insn)
+           || (LABEL_P (insn) && !LABEL_PRESERVE_P (insn))))
        return false;
       insn = PREV_INSN (insn);
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]