PR97359: Do not cache relops in GORI cache.
logical_stmt_cache::cacheable_p() returns true for relops, but
logical_combine (which does the caching) doesn't handle them and ICEs.
This patch fixes the inconsistency by returning false for relops.
This was working before because even though logical_combine doesn't
handle relops, statements with only one SSA are handled in cache_stmt,
which seems like the only statement we've ever encountered (even through
a full Fedora build).
lhs = s_5 > 999;
However, with two SSA operands we ICE because logical_combine doesn't
handle them:
lhs = s_5 > y_8;
We can either return false for relops in cacheable_p, or fix
logical_combine to handle them. The original idea was to only cache
ANDs and ORs, so I've done the former to unbreak trunk.
We can decide later if there was ever any benefit in caching relops.
gcc/ChangeLog:
PR tree-optimization/97359
* gimple-range-gori.cc (logical_stmt_cache::cacheable_p): Only
handle ANDs and ORs.
(gori_compute_cache::cache_stmt): Adjust comment.
gcc/testsuite/ChangeLog:
* gcc.dg/pr97359.c: New test.