[Bug tree-optimization/125290] [16 Regression] ICE at -O3 during GIMPLE pass: ifcvt

"cvs-commit at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125290

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Andrea Pinski
<[email protected]>:

https://gcc.gnu.org/g:8a8b309e0ec8447ad08e3d1c99b3b37e18272f02

commit r16-9411-g8a8b309e0ec8447ad08e3d1c99b3b37e18272f02
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]>
    (cherry picked from commit f108e23d2bff50d0ee8cf0d25a08be5432b702b6)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.