[Bug tree-optimization/103680] Jump threading and switch corrupts profile

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Nov 30 13:04:11 GMT 2022


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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Liska <marxin@gcc.gnu.org>:

https://gcc.gnu.org/g:4fa25a7eb322f0a003c1eb15680c71ece345e01e

commit r13-4409-g4fa25a7eb322f0a003c1eb15680c71ece345e01e
Author: Martin Liska <mliska@suse.cz>
Date:   Mon Jan 24 15:45:38 2022 +0100

    Improve profile handling in switch lowering.

            PR tree-optimization/101301
            PR tree-optimization/103680

    gcc/ChangeLog:

            * tree-switch-conversion.cc (bit_test_cluster::emit):
            Handle correctly remaining probability.
            (switch_decision_tree::try_switch_expansion): Fix BB's count
            where a cluster expansion happens.
            (switch_decision_tree::emit_cmp_and_jump_insns): Fill up also
            BB count.
            (switch_decision_tree::do_jump_if_equal): Likewise.
            (switch_decision_tree::emit_case_nodes): Handle special case
            for BT expansion which can also fallback to a default BB.
            * tree-switch-conversion.h (cluster::cluster): Add
            m_default_prob probability.


More information about the Gcc-bugs mailing list