From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12230 invoked by alias); 18 Nov 2014 16:55:12 -0000 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 Received: (qmail 11966 invoked by uid 55); 18 Nov 2014 16:55:08 -0000 From: "joseph at codesourcery dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/63764] [5 Regression] ICE: in verify_ssa, at tree-ssa.c:939 Date: Tue, 18 Nov 2014 16:55:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: joseph at codesourcery dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-11/txt/msg01741.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63764 --- Comment #9 from joseph at codesourcery dot com --- On Tue, 18 Nov 2014, jakub at gcc dot gnu.org wrote: > > Maybe build_array_ref needs to ensure that references to elements of > > non-lvalue vectors don't become lvalues? (This would be different to > > non-lvalue arrays arising from non-lvalue structs and unions, where the > > result of an array reference *is* an lvalue but modifying it, or accessing > > it after the next sequence point, has undefined behavior.) > > Apparently I misremembered it, trying it again, I see the VCE still there in > *vecp upon entry to convert_vector_to_pointer_for_subscript, the difference > between VIEW_CONVERT_EXPR and NON_LVALUE_EXPR is just that > c_common_mark_addressable_vec looks through VCE and marks the inner part as > addressable (because VCE is handled_component_p), while for non_lvalue_expr it > does not. > > So, shall we convert_vector_to_pointer_for_subscript add something like > if (!lvalue_p (*vecp)) > error_at (...); ? > What wording for it? I'd think it's reasonable to subscript a non-lvalue vector (including e.g. the return value of a function with vector return type) - this might of course need to create a temporary object, as with non-lvalue arrays.