https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125290
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <[email protected]>: https://gcc.gnu.org/g:f108e23d2bff50d0ee8cf0d25a08be5432b702b6 commit r17-536-gf108e23d2bff50d0ee8cf0d25a08be5432b702b6 Author: Andrew Pinski <[email protected]> Date: Wed May 13 21:24:43 2026 -0700 tree-cfg: Revert part of r8-546 [PR125290] This reverts the group_case_labels_stmt part of r8-546-gca4d2851687875. This is placed in the wrong location to remove the case statements that go directly to __builtin_unreachable. In fact the removal of the case statements make us lose optimizations in some cases (Wuninitialized-pr107919-1.C for one). Also this fixes PR 125290 by no longer leaving around a switch which just has a default case. Bootstrapped and tested on x86_64-linux-gnu. PR tree-optimization/125290 gcc/ChangeLog: * tree-cfg.cc (group_case_labels_stmt): Remove code that was added to remove `cases` that goto blocks of unreachable. * tree-ssa-forwprop.cc (optimize_unreachable): Remove the comment about switch cases being handled. gcc/testsuite/ChangeLog: * g++.dg/warn/Wuninitialized-pr107919-1.C: Remove xfail. * gcc.dg/analyzer/taint-assert.c: Update for the non-removal of block containing unreachable. * gcc.dg/torture/pr125290-1.c: New test. Signed-off-by: Andrew Pinski <[email protected]>
