This is the mail archive of the gcc-patches@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]

Re: [PATCH] Disallow VECTOR_CSTs with missing elements


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.

-Nathan


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