https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88854
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2019-01-15 Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Confirmed. For f the CSE opportunity makes the lookup for redudnant store detection fail since that is not allowed to use TBAA. The following fixes that at the cost of some extra hash table entries: Index: gcc/tree-ssa-sccvn.c =================================================================== --- gcc/tree-ssa-sccvn.c (revision 267930) +++ gcc/tree-ssa-sccvn.c (working copy) @@ -4088,7 +4088,11 @@ visit_reference_op_load (tree lhs, tree } if (result) - changed = set_ssa_val_to (lhs, result); + { + changed = set_ssa_val_to (lhs, result); + if (last_vuse != gimple_vuse (stmt)) + vn_reference_insert (op, result, gimple_vuse (stmt), NULL_TREE); + } else { changed = set_ssa_val_to (lhs, lhs); the same happens for g thus g is fixed as well.