[Bug tree-optimization/123300] [14/15/16 Regression] Adding [[assume((1<<i) > 0)]]/__builtin_unreachable generates an infinite loop

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 7 14:43:43 GMT 2026


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

--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andrew Macleod <amacleod@gcc.gnu.org>:

https://gcc.gnu.org/g:849b8f250c6e2a441c46ef1c6fcab7041cd25e03

commit r16-6551-g849b8f250c6e2a441c46ef1c6fcab7041cd25e03
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Tue Jan 6 10:14:47 2026 -0500

    Early builtin_unreachable removal must examine dependencies.

    Even if all uses of a name are dominated by the unreachable branch,
    recomputation of a value in the defintion of a name might be reachable.

            PR tree-optimization/123300
            gcc/
            * gimple-range-gori.cc (gori_map::exports_and_deps): New.
            * gimple-range-gori.h (exports_and_deps): New prototype.
            (FOR_EACH_GORI_EXPORT_AND_DEP_NAME): New macro.
            * tree-vrp.cc (remove_unreachable:remove_unreachable): Initialize
            m_tmp bitmap.
            (remove_unreachable:~remove_unreachable): Dispose of m_tmp bitmap.
            (remove_unreachable:fully_replaceable): Move from static function
            and check reachability of exports and dependencies.

            gcc/testsuite/
            * gcc.dg/pr123300.c: New.


More information about the Gcc-bugs mailing list