aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Ball <richard.ball@arm.com>2023-08-01 16:57:02 +0100
committerRichard Ball <richard.ball@arm.com>2023-08-01 17:00:09 +0100
commit7c09e7e24b0d04857d5880197959e75bda0c489e (patch)
tree483cd98cfb0ec450552a8128453eac8e254230e7 /gcc
parenta5451b8b9f3a6ab0cb1a60bc8b0b76cca46b080f (diff)
downloadgcc-7c09e7e24b0d04857d5880197959e75bda0c489e.zip
gcc-7c09e7e24b0d04857d5880197959e75bda0c489e.tar.gz
gcc-7c09e7e24b0d04857d5880197959e75bda0c489e.tar.bz2
[PATCH] Add POLY_INT_CST support to fold_ctor_reference in gimple-fold.cc
Add POLY_INT_CST support to code within fold_ctor_reference. This code previously only supported INTEGER_CST which caused a bug when using VEC_PERM_EXPR with SVE vectors. gcc/ChangeLog: * gimple-fold.cc (fold_ctor_reference): Add support for poly_int.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/gimple-fold.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/gimple-fold.cc b/gcc/gimple-fold.cc
index 86b8347..fd01810 100644
--- a/gcc/gimple-fold.cc
+++ b/gcc/gimple-fold.cc
@@ -8159,8 +8159,8 @@ fold_ctor_reference (tree type, tree ctor, const poly_uint64 &poly_offset,
result. */
if (!AGGREGATE_TYPE_P (TREE_TYPE (ctor)) && !offset
/* VIEW_CONVERT_EXPR is defined only for matching sizes. */
- && !compare_tree_int (TYPE_SIZE (type), size)
- && !compare_tree_int (TYPE_SIZE (TREE_TYPE (ctor)), size))
+ && known_eq (wi::to_poly_widest (TYPE_SIZE (type)), size)
+ && known_eq (wi::to_poly_widest (TYPE_SIZE (TREE_TYPE (ctor))), size))
{
ret = canonicalize_constructor_val (unshare_expr (ctor), from_decl);
if (ret)