This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/53094] constexpr vector subscripting


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]