tree-optimization/116905 - ICE with bogus range ops
Checks
Commit Message
The following avoids querying ranges of vector entities.
Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.
Richard.
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.
---
gcc/testsuite/gcc.dg/pr116905.c | 14 ++++++++++++++
gcc/tree-vect-stmts.cc | 6 ++++--
2 files changed, 18 insertions(+), 2 deletions(-)
create mode 100644 gcc/testsuite/gcc.dg/pr116905.c
new file mode 100644
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target float16 } */
+/* { dg-options "-frounding-math" } */
+/* { dg-additional-options "-mavx" { target avx } } */
+
+typedef __attribute__((__vector_size__(16))) _Float16 F;
+typedef __attribute__((__vector_size__(32))) int V;
+F f;
+
+void
+foo()
+{
+ f += __builtin_convertvector((V){3307}, F);
+}
@@ -14805,8 +14805,10 @@ supportable_indirect_convert_operation (code_helper code,
In the future, if it is supported, changes may need to be made
to this part, such as checking the RANGE of each element
in the vector. */
- if ((TREE_CODE (op0) == SSA_NAME && !SSA_NAME_RANGE_INFO (op0))
- || !vect_get_range_info (op0, &op_min_value, &op_max_value))
+ if (TREE_CODE (op0) != SSA_NAME
+ || !SSA_NAME_RANGE_INFO (op0)
+ || !vect_get_range_info (op0, &op_min_value,
+ &op_max_value))
break;
if (cvt_type == NULL_TREE