public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [COMMITTED 5/5] Remove incorrect asserts.
@ 2024-04-30 21:24 Andrew MacLeod
  0 siblings, 0 replies; only message in thread
From: Andrew MacLeod @ 2024-04-30 21:24 UTC (permalink / raw)
  To: gcc-patches; +Cc: hernandez, aldy

[-- Attachment #1: Type: text/plain, Size: 208 bytes --]

while working on some new range-op enhancements, I found a couple of 
developing asserts that no longer apply.  This removed them.

Bootstrapped on x86_64-pc-linux-gnu with no regressions.  pushed.

Andrew

[-- Attachment #2: 0005-Remove-incorrect-asserts.patch --]
[-- Type: text/x-patch, Size: 1374 bytes --]

From a89de3a24d2312438848e513a0b02b480d52c81e Mon Sep 17 00:00:00 2001
From: Andrew MacLeod <amacleod@redhat.com>
Date: Tue, 13 Feb 2024 10:07:11 -0500
Subject: [PATCH 5/9] Remove incorrect asserts.

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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/gimple-range-op.cc b/gcc/gimple-range-op.cc
index 9c50c00549e..587de186db2 100644
--- a/gcc/gimple-range-op.cc
+++ b/gcc/gimple-range-op.cc
@@ -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;
 
-- 
2.41.0


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

only message in thread, other threads:[~2024-04-30 21:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-30 21:24 [COMMITTED 5/5] Remove incorrect asserts Andrew MacLeod

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).