]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Remove incorrect asserts.
authorAndrew MacLeod <amacleod@redhat.com>
Tue, 13 Feb 2024 15:07:11 +0000 (10:07 -0500)
committerAndrew MacLeod <amacleod@redhat.com>
Tue, 30 Apr 2024 21:19:58 +0000 (17:19 -0400)
Gimple_range_op handles builtin functions, and a couple of asserts that
are in place are incorrect in this context, so just remove them.

* gimple-range-op.cc (gimple_range_op_handler::calc_op1): Don't
assert that here are less than 3 operands.
(gimple_range_op_handler::maybe_builtin_call): Simply return if
there is no type for the function call.

gcc/gimple-range-op.cc

index 9c50c00549efe881a931c4444cc3d4fc20e4fcaf..587de186db28f4fc8e3cc3e8c7ff7776321e56a4 100644 (file)
@@ -178,7 +178,6 @@ gimple_range_op_handler::gimple_range_op_handler (gimple *s)
 bool
 gimple_range_op_handler::calc_op1 (vrange &r, const vrange &lhs_range)
 {
-  gcc_checking_assert (gimple_num_ops (m_stmt) < 3);
   // Give up on empty ranges.
   if (lhs_range.undefined_p ())
     return false;
@@ -1213,7 +1212,8 @@ gimple_range_op_handler::maybe_builtin_call ()
   if (func == CFN_LAST)
     return;
   tree type = gimple_range_type (call);
-  gcc_checking_assert (type);
+  if (!type)
+    return;
   if (!Value_Range::supports_type_p (type))
     return;