This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PR tree-optimization/84225: do not pass non-integers to operation_no_trapping_overflow
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc: Jakub Jelinek <jakub at redhat dot com>
- Date: Tue, 6 Feb 2018 10:43:21 -0500
- Subject: PR tree-optimization/84225: do not pass non-integers to operation_no_trapping_overflow
- Authentication-results: sourceware.org; auth=none
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)