[Bug c++/51033] generic vector subscript and shuffle support was not added to C++
marc.glisse at normalesup dot org
gcc-bugzilla@gcc.gnu.org
Sun Apr 22 13:22:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033
--- Comment #20 from Marc Glisse <marc.glisse at normalesup dot org> 2012-04-22 13:21:14 UTC ---
(In reply to comment #19)
> Created attachment 27217 [details]
> shuffle
Doesn't work with -std=c++11, which requires:
--- semantics.c (revision 186667)
+++ semantics.c (working copy)
@@ -5603,11 +5603,12 @@ float_const_decimal64_p (void)
bool
literal_type_p (tree t)
{
if (SCALAR_TYPE_P (t)
- || TREE_CODE (t) == REFERENCE_TYPE)
+ || TREE_CODE (t) == REFERENCE_TYPE
+ || TREE_CODE (t) == VECTOR_TYPE)
return true;
if (CLASS_TYPE_P (t))
{
t = complete_type (t);
gcc_assert (COMPLETE_TYPE_P (t) || errorcount);
@@ -8487,10 +8488,11 @@ potential_constant_expression_1 (tree t,
want_rval, flags))
return false;
return true;
case FMA_EXPR:
+ case VEC_PERM_EXPR:
for (i = 0; i < 3; ++i)
if (!potential_constant_expression_1 (TREE_OPERAND (t, i),
true, flags))
return false;
return true;
And then I still need to write a cxx_eval_vec_perm function so the result of
__builtin_shuffle can be constexpr. I haven't seen how the C front-end handles
shuffles of constants. Maybe a "sorry" would do for now.
More information about the Gcc-bugs
mailing list