https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65917

--- Comment #4 from Jeffrey A. Law <law at redhat dot com> ---
We'll probably need to XFAIL this for now.

This is definitely a case where we were just getting lucky before and the new
code to canonicalize the comparison arguments causes us not to get lucky.

The single use heuristic doesn't help here, because both operands have multiple
uses.

I'd pondered walking up the use-def chains to guess which operand is more
expensive to compute and use that as a heuristic as well, but in this case it'd
do the opposite of what we want.

I don't see other obvious heuristics that would resolve this issue.

The "right" way to fix this would be to unify cprop and simplification -- ie,
when we have a statement that references an SSA_NAME with one of these
equivalences, we need to try both SSA_NAMEs and see if it simplifies.  I've
avoided doing that simply because it hasn't seemed worth the effort and
compile-time cost.

Reply via email to