https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106126
Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED --- Comment #14 from Martin Liška <marxin at gcc dot gnu.org> --- (In reply to luoxhu from comment #13) > Otherwise we need record first_bb when conditions_in_bbs->is_empty, then > check that in is_beneficial, ordered_remove the info entry if that bb is not > the first "if condition" with side_effect statement in it, the fix would be No, we need to record if a BB has a side effect and allow only side effects for a first BB in the main loop in pass_if_to_switch::execute. I'm testing a patch candidate. > as below, but I am not sure whether it is worth&correct way doing this to > handle both PR105740 and PR106126? Well, I replied in PR105740 where the problem is one needs to run the pass later.