https://gcc.gnu.org/g:6b5e2f6e5bad9c320c6c40fd51dc70f741d96933
commit r16-4409-g6b5e2f6e5bad9c320c6c40fd51dc70f741d96933 Author: Andrew Pinski <[email protected]> Date: Mon Oct 13 16:47:55 2025 -0700 phi-opt: Disable parts of it for -Og While working on the cselim limited part of phiopt, I noticed that the debugging experience for -Og case would cause jumping execution in some cases. So this disables the store and operation factoring parts for -Og since those 2 can cause the line information of the debugging to be off. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * tree-ssa-phiopt.cc (pass_phiopt::execute): Disable cselim-limited and factor out operations for -Og. Signed-off-by: Andrew Pinski <[email protected]> Diff: --- gcc/tree-ssa-phiopt.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc index 9f7f662d7cf7..031184d9e583 100644 --- a/gcc/tree-ssa-phiopt.cc +++ b/gcc/tree-ssa-phiopt.cc @@ -4569,8 +4569,8 @@ pass_phiopt::execute (function *) hoist_adjacent_loads (bb, bb1, bb2, bb3); /* Try to see if there are only store in each side of the if - and try to remove that. */ - if (EDGE_COUNT (bb3->preds) == 2) + and try to remove that; don't do this for -Og. */ + if (EDGE_COUNT (bb3->preds) == 2 && !optimize_debug) while (cond_if_else_store_replacement_limited (bb1, bb2, bb3)) ; } @@ -4586,7 +4586,8 @@ pass_phiopt::execute (function *) /* Factor out operations from the phi if possible. */ if (single_pred_p (bb1) - && EDGE_COUNT (merge->preds) == 2) + && EDGE_COUNT (merge->preds) == 2 + && !optimize_debug) { for (gsi = gsi_start (phis); !gsi_end_p (gsi); ) {
