public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [COMMITTED] [PR middle-end/106432] Gracefully handle unsupported type in range_on_edge
@ 2022-07-25 15:30 Aldy Hernandez
  0 siblings, 0 replies; only message in thread
From: Aldy Hernandez @ 2022-07-25 15:30 UTC (permalink / raw)
  To: GCC patches

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.

gcc/ChangeLog:

	* gimple-range.cc (gimple_ranger::range_on_edge): Return false
          when the result range type is unsupported.
---
 gcc/gimple-range.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/gimple-range.cc b/gcc/gimple-range.cc
index 7ac48303e4e..eb347eee45b 100644
--- a/gcc/gimple-range.cc
+++ b/gcc/gimple-range.cc
@@ -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)
-- 
2.36.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-25 15:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-25 15:30 [COMMITTED] [PR middle-end/106432] Gracefully handle unsupported type in range_on_edge Aldy Hernandez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).