aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-09-18 15:42:08 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-09-18 15:42:08 +0000
commitac8936b4677fa10b676e5b12aa682b9d2d42c1e5 (patch)
tree59d050791a2f94e34d70ce4be586d4fc30974f7d /gcc
parentb161f2c927bb7fb70dc0c6d4e9ab22cdba29db6d (diff)
downloadgcc-ac8936b4677fa10b676e5b12aa682b9d2d42c1e5.zip
gcc-ac8936b4677fa10b676e5b12aa682b9d2d42c1e5.tar.gz
gcc-ac8936b4677fa10b676e5b12aa682b9d2d42c1e5.tar.bz2
Fix an SVE failure in the Fortran matmul* tests
The vectoriser was calling vect_get_smallest_scalar_type without having proven that the type actually is a scalar. This seems to be the intended behaviour: the ultimate test of whether the type is interesting (and hence scalar) is whether an associated vector type exists, but this is only tested later. The patch simply makes the function cope gracefully with non-scalar inputs. 2017-09-18 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * tree-vect-data-refs.c (vect_get_smallest_scalar_type): Cope with types that aren't in fact scalar. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r252934
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/tree-vect-data-refs.c5
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 130793e..2f8cde4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,4 +1,11 @@
2017-09-18 Richard Sandiford <richard.sandiford@linaro.org>
+ Alan Hayward <alan.hayward@arm.com>
+ David Sherwood <david.sherwood@arm.com>
+
+ * tree-vect-data-refs.c (vect_get_smallest_scalar_type): Cope
+ with types that aren't in fact scalar.
+
+2017-09-18 Richard Sandiford <richard.sandiford@linaro.org>
* tree-vect-slp.c (vect_record_max_nunits): New function,
split out from...
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index c409dc7..cab2f2f 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -118,6 +118,11 @@ vect_get_smallest_scalar_type (gimple *stmt, HOST_WIDE_INT *lhs_size_unit,
tree scalar_type = gimple_expr_type (stmt);
HOST_WIDE_INT lhs, rhs;
+ /* During the analysis phase, this function is called on arbitrary
+ statements that might not have scalar results. */
+ if (!tree_fits_uhwi_p (TYPE_SIZE_UNIT (scalar_type)))
+ return scalar_type;
+
lhs = rhs = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (scalar_type));
if (is_gimple_assign (stmt)