This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++] Fix __builtin_shuffle
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 27 Jun 2013 17:24:45 +0200 (CEST)
- Subject: Re: [C++] Fix __builtin_shuffle
- References: <alpine dot DEB dot 2 dot 02 dot 1306091302380 dot 27498 at stedding dot saclay dot inria dot fr> <51CB558B dot 6090905 at redhat dot com> <alpine dot DEB dot 2 dot 10 dot 1306271344370 dot 26429 at stedding dot saclay dot inria dot fr> <51CC2F9D dot 908 at redhat dot com>
On Thu, 27 Jun 2013, Jason Merrill wrote:
On 06/27/2013 07:59 AM, Marc Glisse wrote:
I assume I can't call directly c_build_vec_perm_expr on the original
arguments without build_non_dependent_expr?
It looks like c_build_vec_perm_expr is safe to take the original arguments,
since it doesn't look deep into the expression. So either way is fine.
Cool, I'll go with the short version then (I tested it before posting):
+tree
+build_x_vec_perm_expr (location_t loc,
+ tree arg0, tree arg1, tree arg2,
+ tsubst_flags_t complain)
+{
+ if (processing_template_decl
+ && (type_dependent_expression_p (arg0)
+ || type_dependent_expression_p (arg1)
+ || type_dependent_expression_p (arg2)))
+ return build_min_nt_loc (loc, VEC_PERM_EXPR, arg0, arg1, arg2);
+ return c_build_vec_perm_expr (loc, arg0, arg1, arg2, complain & tf_error);
+}
By the way, should I rename cp_build_vec_perm_expr as
build_x_vec_perm_expr, since most of its code is copied from
build_x_binary_op and not cp_build_binary_op?
Makes sense. OK with that change.
Thanks.
--
Marc Glisse