aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2018-01-16 12:44:37 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-01-16 12:44:37 +0000
commit3c869ac3059f5201d6928ec84d5173114e37dfd7 (patch)
treef9cf8f46fcc5b4270749c7fa296abe771db049c1 /gcc/fold-const.c
parentcce6078d2b6bacc35a5097ae63e3d8570bb00ae4 (diff)
downloadgcc-3c869ac3059f5201d6928ec84d5173114e37dfd7.zip
gcc-3c869ac3059f5201d6928ec84d5173114e37dfd7.tar.gz
gcc-3c869ac3059f5201d6928ec84d5173114e37dfd7.tar.bz2
Avoid GCC 4.1 build failure in fold-const.c
We had: tree t = fold_vec_perm (type, arg1, arg2, vec_perm_indices (sel, 2, nelts)); where fold_vec_perm takes a const vec_perm_indices &. GCC 4.1 apparently required a public copy constructor: gcc/vec-perm-indices.h:85: error: 'vec_perm_indices::vec_perm_indices(const vec_perm_indices&)' is private gcc/fold-const.c:11410: error: within this context even though no copy should be made here. This patch tries to work around that by constructing the vec_perm_indices separately. 2018-01-16 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * fold-const.c (fold_ternary_loc): Construct the vec_perm_indices in a separate statement. From-SVN: r256740
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index f3749db..5cf2052 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -11406,8 +11406,8 @@ fold_ternary_loc (location_t loc, enum tree_code code, tree type,
else /* Currently unreachable. */
return NULL_TREE;
}
- tree t = fold_vec_perm (type, arg1, arg2,
- vec_perm_indices (sel, 2, nelts));
+ vec_perm_indices indices (sel, 2, nelts);
+ tree t = fold_vec_perm (type, arg1, arg2, indices);
if (t != NULL_TREE)
return t;
}