This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PR tree-optimization/84225: do not pass non-integers to operation_no_trapping_overflow


In this PR we are ICEing here:

bool
operation_no_trapping_overflow (tree type, enum tree_code code)
{
  gcc_checking_assert (ANY_INTEGRAL_TYPE_P (type));

...because we are being passed a pointer type from find_trapping_overflow.

Fixed by avoiding passing non-integrals from find_trapping_overflow.

Pre-approved by Jakub.  Committed.

Tested on x86-64 Linux.
gcc/

	PR tree-optimization/84225
	* tree-eh.c (find_trapping_overflow): Only call
	operation_no_trapping_overflow when ANY_INTEGRAL_TYPE_P.

diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 75385f7b53f..9862ed9fdda 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -2729,6 +2729,7 @@ static tree
 find_trapping_overflow (tree *tp, int *walk_subtrees, void *data)
 {
   if (EXPR_P (*tp)
+      && ANY_INTEGRAL_TYPE_P (TREE_TYPE (*tp))
       && !operation_no_trapping_overflow (TREE_TYPE (*tp), TREE_CODE (*tp)))
     return *tp;
   if (IS_TYPE_OR_DECL_P (*tp)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]