]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
phi-opt: Disable parts of it for -Og
authorAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Mon, 13 Oct 2025 23:47:55 +0000 (16:47 -0700)
committerAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Tue, 14 Oct 2025 06:46:11 +0000 (23:46 -0700)
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 <andrew.pinski@oss.qualcomm.com>
gcc/tree-ssa-phiopt.cc

index 9f7f662d7cf7beb421da08701fe6f5cc1615c991..031184d9e583a16e1d8b158c54cbdd7286040dab 100644 (file)
@@ -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); )
            {