------- Comment #5 from steven at gcc dot gnu dot org 2005-12-03 17:46 ------- Actually, it's more related to Bug 21488. What happens is that we record a value for the left hand side of a single-argument PHI node (i.e. for "rhs=PHI(lhs)" we record an equivalence rhs==lhs), but the left hand side also already has a value (in this case, lhs==4).
Later on we don't copy propagate lhs into the uses of rhs because lhs is defined in a loop and we don't copy propagate out of loops, so we never see that rhs==4 too. My hack in comment #3 propagates the value "4" by following SSA_NAME_VALUE links as deeply as possible. What we should probably do instead is look through SSA_NAME_VALUE chains in record_equivalences_from_phis. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25243