This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/51513] Only partially optimizes away __builtin_unreachable switch default case
- From: "bergner at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 29 Apr 2015 14:58:06 +0000
- Subject: [Bug tree-optimization/51513] Only partially optimizes away __builtin_unreachable switch default case
- Auto-submitted: auto-generated
- References: <bug-51513-4 at http dot gcc dot gnu dot org/bugzilla/>
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);
}