From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8789 invoked by alias); 3 Dec 2012 19:53:04 -0000 Received: (qmail 7878 invoked by uid 48); 3 Dec 2012 19:52:40 -0000 From: "glisse at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/53094] constexpr vector subscripting Date: Mon, 03 Dec 2012 19:53: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: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: glisse at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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-12/txt/msg00286.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53094 --- Comment #10 from Marc Glisse 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.