From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13199 invoked by alias); 4 Oct 2011 14:41:50 -0000 Received: (qmail 13184 invoked by uid 22791); 4 Oct 2011 14:41:48 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 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; Tue, 04 Oct 2011 14:41:30 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/50609] [4.7 Regression] FAIL: gcc.c-torture/execute/pr23135.c compilation, -O2 -flto (ICE) Date: Tue, 04 Oct 2011 14:41:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.0 X-Bugzilla-Changed-Fields: Status AssignedTo 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: 2011-10/txt/msg00192.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50609 Richard Guenther changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED AssignedTo|unassigned at gcc dot |rguenth at gcc dot gnu.org |gnu.org | --- Comment #5 from Richard Guenther 2011-10-04 14:41:04 UTC --- Hm, this means we have an unfolded vector CONSTRUCTOR, we should have a VECTOR_CST here. Or the following, reproducible on x86_64 with -m32: typedef int v4si __attribute__((vector_size(16))); int x; static const v4si v = { (int)&x, 2, 3, 4 }; int foo () { return v[0]; } I have a patch. You might want to check it. Index: gcc/gimple-fold.c =================================================================== --- gcc/gimple-fold.c (revision 179505) +++ gcc/gimple-fold.c (working copy) @@ -2747,10 +2747,12 @@ fold_array_ctor_reference (tree type, tr double_int low_bound, elt_size; double_int index, max_index; double_int access_index; - tree domain_type = TYPE_DOMAIN (TREE_TYPE (ctor)); + tree domain_type = NULL_TREE; HOST_WIDE_INT inner_offset; /* Compute low bound and elt size. */ + if (TREE_CODE (ctor) == ARRAY_TYPE) + domain_type = TYPE_DOMAIN (TREE_TYPE (ctor)); if (domain_type && TYPE_MIN_VALUE (domain_type)) { /* Static constructors for variably sized objects makes no sense. */ @@ -2917,7 +2919,8 @@ fold_ctor_reference (tree type, tree cto if (TREE_CODE (ctor) == CONSTRUCTOR) { - if (TREE_CODE (TREE_TYPE (ctor)) == ARRAY_TYPE) + if (TREE_CODE (TREE_TYPE (ctor)) == ARRAY_TYPE + || TREE_CODE (TREE_TYPE (ctor)) == VECTOR_TYPE) return fold_array_ctor_reference (type, ctor, offset, size); else return fold_nonarray_ctor_reference (type, ctor, offset, size);