This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Avoid GCC 4.1 build failure in fold-const.c
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, richard dot sandiford at linaro dot org
- Date: Tue, 16 Jan 2018 13:12:41 +0100
- Subject: Re: Avoid GCC 4.1 build failure in fold-const.c
- Authentication-results: sourceware.org; auth=none
- References: <87bmhuxatr.fsf@linaro.org>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Jan 16, 2018 at 12:11:28PM +0000, Richard Sandiford wrote:
> 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.
>
> Tested on aarch64-linux-gnu. OK to install?
>
> Richard
>
>
> 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.
Ok, thanks.
> Index: gcc/fold-const.c
> ===================================================================
> --- gcc/fold-const.c 2018-01-15 12:38:28.967896418 +0000
> +++ gcc/fold-const.c 2018-01-16 12:08:10.082222501 +0000
> @@ -11406,8 +11406,8 @@ fold_ternary_loc (location_t loc, enum t
> 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;
> }
Jakub