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 <[email protected]>
---
 gcc/tree-ssa-phiopt.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
index b18e5aa9c06..c73a81c4166 100644
--- a/gcc/tree-ssa-phiopt.cc
+++ b/gcc/tree-ssa-phiopt.cc
@@ -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);
-- 
2.43.0

Reply via email to