Skip to content

Commit 60fa7f5

Browse files
rguenthRichard Biener
authored and
Richard Biener
committed
tree-optimization/116905 - ICE with bogus range ops
The following avoids querying ranges of vector entities. PR tree-optimization/116905 * tree-vect-stmts.cc (supportable_indirect_convert_operation): Fix guard for vect_get_range_info. * gcc.dg/pr116905.c: New testcase.
1 parent 3e1bd64 commit 60fa7f5

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

gcc/testsuite/gcc.dg/pr116905.c

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* { dg-do compile } */
2+
/* { dg-require-effective-target float16 } */
3+
/* { dg-options "-frounding-math" } */
4+
/* { dg-additional-options "-mavx" { target avx } } */
5+
6+
typedef __attribute__((__vector_size__(16))) _Float16 F;
7+
typedef __attribute__((__vector_size__(32))) int V;
8+
F f;
9+
10+
void
11+
foo()
12+
{
13+
f += __builtin_convertvector((V){3307}, F);
14+
}

gcc/tree-vect-stmts.cc

+4-2
Original file line numberDiff line numberDiff line change
@@ -14803,8 +14803,10 @@ supportable_indirect_convert_operation (code_helper code,
1480314803
In the future, if it is supported, changes may need to be made
1480414804
to this part, such as checking the RANGE of each element
1480514805
in the vector. */
14806-
if ((TREE_CODE (op0) == SSA_NAME && !SSA_NAME_RANGE_INFO (op0))
14807-
|| !vect_get_range_info (op0, &op_min_value, &op_max_value))
14806+
if (TREE_CODE (op0) != SSA_NAME
14807+
|| !SSA_NAME_RANGE_INFO (op0)
14808+
|| !vect_get_range_info (op0, &op_min_value,
14809+
&op_max_value))
1480814810
break;
1480914811

1481014812
if (cvt_type == NULL_TREE

0 commit comments

Comments
 (0)