This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Disallow VECTOR_CSTs with missing elements
- From: Nathan Froyd <froydnj at codesourcery dot com>
- To: Richard Guenther <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 29 Jul 2010 05:42:09 -0700
- Subject: Re: [PATCH] Disallow VECTOR_CSTs with missing elements
- References: <alpine.LNX.firstname.lastname@example.org>
On Thu, Jul 29, 2010 at 12:39:18PM +0200, Richard Guenther wrote:
> The user can happily provide not enough elements for the initializer
> of a vector variable which eventually leads to build_vector_from_ctor
> constructing a VECTOR_CST with an element count that does not match
> TYPE_VECTOR_SUBPARTS. Not a good thing to have in our IL (and nothing
> existing code expects).
Could you add tree verification code to enforce this?
Does this imply that having TREE_VECTOR_CST_ELTS be NULL is invalid?
There's a lot of code in the middle-end and backends (sparc comes
immediately to mind) that is needlessly complex because it checks for
NULL TREE_VECTOR_CST_ELTS. If such a state is indeed invalid, it would
simplify things immensely.