https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106126
--- Comment #16 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Martin Liska <mar...@gcc.gnu.org>: https://gcc.gnu.org/g:618bac5b486832edd3f8eb3ada74740e389dfcb8 commit r13-1375-g618bac5b486832edd3f8eb3ada74740e389dfcb8 Author: Martin Liska <mli...@suse.cz> Date: Thu Jun 30 15:00:17 2022 +0200 if-to-switch: properly allow side effects only for first condition Properly allow side effects only for a first BB in a condition chain. PR tree-optimization/106126 gcc/ChangeLog: * gimple-if-to-switch.cc (struct condition_info): Save has_side_effect. (find_conditions): Parse all BBs. (pass_if_to_switch::execute): Allow only side effects for first BB. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr106126.c: New test.