aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2018-08-28 10:42:42 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-08-28 10:42:42 +0000
commit4ec4324d0f2425ad64540d4c4d8d29f8e8077c3d (patch)
treecb7bff7e7b49f1866987d495f95779e67716a70f /gcc
parent463a9e0d31351d1b97f98da03cacb0b1867edad5 (diff)
downloadgcc-4ec4324d0f2425ad64540d4c4d8d29f8e8077c3d.zip
gcc-4ec4324d0f2425ad64540d4c4d8d29f8e8077c3d.tar.gz
gcc-4ec4324d0f2425ad64540d4c4d8d29f8e8077c3d.tar.bz2
Fix unguarded use of tree_to_shwi in tree-ssa-sccvn.c
Fixes many testsuite failures for SVE. 2018-08-28 Richard Sandiford <richard.sandiford@arm.com> gcc/ * tree-ssa-sccvn.c (fully_constant_vn_reference_p): Fix unguarded use of tree_to_shwi. Remove duplicated test for the size being a whole number of bytes. From-SVN: r263914
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-ssa-sccvn.c8
2 files changed, 10 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a357b4b..0e2f9d0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2018-08-28 Richard Sandiford <richard.sandiford@arm.com>
+
+ * tree-ssa-sccvn.c (fully_constant_vn_reference_p): Fix unguarded
+ use of tree_to_shwi. Remove duplicated test for the size being
+ a whole number of bytes.
+
2018-08-28 Richard Biener <rguenther@suse.de>
PR tree-optimization/87117
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 9277de0..39ad0c5 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -1409,16 +1409,16 @@ fully_constant_vn_reference_p (vn_reference_t ref)
/* Simplify reads from constants or constant initializers. */
else if (BITS_PER_UNIT == 8
&& COMPLETE_TYPE_P (ref->type)
- && is_gimple_reg_type (ref->type)
- && (!INTEGRAL_TYPE_P (ref->type)
- || TYPE_PRECISION (ref->type) % BITS_PER_UNIT == 0))
+ && is_gimple_reg_type (ref->type))
{
poly_int64 off = 0;
HOST_WIDE_INT size;
if (INTEGRAL_TYPE_P (ref->type))
size = TYPE_PRECISION (ref->type);
- else
+ else if (tree_fits_shwi_p (TYPE_SIZE (ref->type)))
size = tree_to_shwi (TYPE_SIZE (ref->type));
+ else
+ return NULL_TREE;
if (size % BITS_PER_UNIT != 0
|| size > MAX_BITSIZE_MODE_ANY_MODE)
return NULL_TREE;