summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-data-refs.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2019-04-08 13:54:02 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2019-04-08 13:54:02 +0000
commita265c9a929b4ca727e9b0c93eb98e15244f2735c (patch)
treeb058f1cb2343f3c7617a416d726b7a0c79311399 /gcc/tree-vect-data-refs.c
parentb8e214c6b32789f96256bf1a89490dbc550a9dc8 (diff)
re PR tree-optimization/90006 (gcc loops indefinitely around vect_get_constant_vectors on -O2 -ftree-slp-vectorize -fno-math-errno)
2019-04-08 Richard Biener <rguenther@suse.de> PR tree-optimization/90006 * tree-vect-data-refs.c (vect_get_smallest_scalar_type): Handle calls like lrint. * gcc.dg/vect/bb-slp-pr90006.c: New testcase. From-SVN: r270210
Diffstat (limited to 'gcc/tree-vect-data-refs.c')
-rw-r--r--gcc/tree-vect-data-refs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index 1380088af6a..8f185c99dad 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -145,6 +145,15 @@ vect_get_smallest_scalar_type (stmt_vec_info stmt_info,
if (rhs < lhs)
scalar_type = rhs_type;
}
+ else if (is_gimple_call (stmt_info->stmt)
+ && gimple_call_num_args (stmt_info->stmt) > 0)
+ {
+ tree rhs_type = TREE_TYPE (gimple_call_arg (stmt_info->stmt, 0));
+
+ rhs = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (rhs_type));
+ if (rhs < lhs)
+ scalar_type = rhs_type;
+ }
*lhs_size_unit = lhs;
*rhs_size_unit = rhs;