https://gcc.gnu.org/g:99d7b4d4de319d5cd4850121a4face976271fce8
commit r17-1754-g99d7b4d4de319d5cd4850121a4face976271fce8 Author: Andrew Pinski <[email protected]> Date: Sun Jun 21 11:48:09 2026 -0700 cselim: Fix comment on why no loads in the middle bb when nontrap 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]> Diff: --- 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 b18e5aa9c069..c73a81c41668 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);
