From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24512 invoked by alias); 22 Apr 2012 13:22:03 -0000 Received: (qmail 24503 invoked by uid 22791); 22 Apr 2012 13:22:02 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 22 Apr 2012 13:21:49 +0000 From: "marc.glisse at normalesup dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/51033] generic vector subscript and shuffle support was not added to C++ Date: Sun, 22 Apr 2012 13:22:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: enhancement X-Bugzilla-Who: marc.glisse at normalesup dot org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-04/txt/msg01831.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033 --- Comment #20 from Marc Glisse 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.