]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
get_tree_range should check the supplied range type.
authorAndrew MacLeod <amacleod@redhat.com>
Tue, 3 Feb 2026 16:37:57 +0000 (11:37 -0500)
committerAndrew MacLeod <amacleod@redhat.com>
Mon, 4 May 2026 15:34:03 +0000 (11:34 -0400)
get_tree_range currently checks whether value_range supports the
requested type which is incorrect.  It should check whether the supplied
vrange supports the type.

* value-query.cc (range_query::get_tree_range): Check if return
range R supports the expression type.

gcc/value-query.cc

index e05f728905ea8dcef7447caded617fa37ea411da..5fbe8f932a67952a0cc954212982e3c614b99509 100644 (file)
@@ -336,7 +336,7 @@ range_query::get_tree_range (vrange &r, tree expr, gimple *stmt,
   else
     type = TREE_TYPE (expr);
 
-  if (!value_range::supports_type_p (type))
+  if (!r.supports_type_p (type))
     {
       r.set_undefined ();
       return false;