[PR middle-end/106432] Gracefully handle unsupported type in range_on_edge

A cleaner approach to fix this PR has been suggested by Andrew, which
is to just return false on range_on_edge for unsupported range types.

Tested on x86-64 Linux.

	PR middle-end/106432

gcc/ChangeLog:

	* gimple-range.cc (gimple_ranger::range_on_edge): Return false
	when the result range type is unsupported.
This commit is contained in:
Aldy Hernandez 2022-07-25 15:58:04 +02:00
parent 4c6567b409
commit ca1e4b26c1

View File

@ -201,7 +201,9 @@ bool
gimple_ranger::range_on_edge (vrange &r, edge e, tree name)
{
Value_Range edge_range (TREE_TYPE (name));
gcc_checking_assert (r.supports_type_p (TREE_TYPE (name)));
if (!r.supports_type_p (TREE_TYPE (name)))
return false;
// Do not process values along abnormal edges.
if (e->flags & EDGE_ABNORMAL)