]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cselim: Fix comment on why no loads in the middle bb when nontrap
authorAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Sun, 21 Jun 2026 18:48:09 +0000 (11:48 -0700)
committerAndrew Pinski <andrew.pinski@oss.qualcomm.com>
Mon, 22 Jun 2026 17:35:34 +0000 (10:35 -0700)
This updates the comment in cond_store_replacement which was
added in r17-1404-gcd33e5ad1945f1 as promised.

Pushed as obvious after bootstrap/test on x86_64-linux-gnu.

gcc/ChangeLog:

* tree-ssa-phiopt.cc (cond_store_replacement): Fix comment
on no load for nontrapping.

Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com>
gcc/tree-ssa-phiopt.cc

index b18e5aa9c069a29ce06c7f099edc39de90e64d80..c73a81c41668ca73d5cc2f60ddd1116bbaee5e15 100644 (file)
@@ -3110,8 +3110,9 @@ cond_store_replacement (basic_block middle_bb, basic_block join_bb, edge e0,
      whose value is not available readily, which we want to avoid.  */
   if (nontrap->contains (lhs))
     {
-      /* Make sure there is no load in the middle bb,
-        this invalidates nontrap.
+      /* For local non-addressable variables, a load in the same bb
+        (though before) will cause the lhs to be in the nontrap hashset.
+        So need to check if there are no other loads in the middle bb.
         FIXME: this is over conserative, this check could be made to
         allow loads unrelated to lhs.  */
       tree vuse = gimple_vuse (assign);