https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51513
--- Comment #7 from Peter Bergner <bergner at gcc dot gnu.org> --- (In reply to Emil L from comment #3) > This optimization would be very interesting for interpreter implementators > that use a switch statement to dispatch the next instruction, when they can > guarantee that the default branch is never taken. I have actually hit the same issue with some code from PHP, so you're not too far off on your comment. A reduced test case from PHP looks like: void foo (unsigned char *ptr, unsigned int cond) { switch (cond) { case 0: return; case 1: case 2: case 3: case 4: case 6: *ptr += 1; return; case 5: *ptr += 2; return; default: __builtin_unreachable (); break; } } In this case, the undeleted branch had a wild label that pointed to nowhere.