This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53094] constexpr vector subscripting
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 03 Dec 2012 19:52:39 +0000
- Subject: [Bug c++/53094] constexpr vector subscripting
- Auto-submitted: auto-generated
- References: <bug-53094-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53094
--- Comment #10 from Marc Glisse <glisse at gcc dot gnu.org> 2012-12-03 19:52:39 UTC ---
Created attachment 28864
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28864
minimal cumulative patch for comment #9
(In reply to comment #9)
> adding it "helps"
> t = build_constructor (TREE_TYPE (t), n);
> + if (TREE_CODE (TREE_TYPE (t)) == VECTOR_TYPE)
> + t = fold (t);
> TREE_CONSTANT (t) = true;
I would have put it after TREE_CONSTANT, but that's not the problem.
> unfortunately generates ICE for the class constructor at cp/tree.c:2712
Indeed, cp_tree_equal is missing a VECTOR_CST case. We can likely just forward
to operand_equal_p.
With this patch (I am not proposing it, it conflicts with Jakub's), your last
code compiles.