From 931002b26597b93aff99d78043b1e838a59861ce Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 22 Sep 2014 12:49:16 +0000 Subject: [PATCH] gimplify.c (gimplify_init_constructor): Do not leave non-GIMPLE vector constructors around. 2014-09-22 Richard Biener * gimplify.c (gimplify_init_constructor): Do not leave non-GIMPLE vector constructors around. * tree-cfg.c (verify_gimple_assign_single): Verify that CONSTRUCTORs have gimple elements. From-SVN: r215461 --- gcc/ChangeLog | 7 +++++++ gcc/gimplify.c | 6 ------ gcc/tree-cfg.c | 12 ++++++++++++ 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 02101ee..ac79f4f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2014-09-22 Richard Biener + + * gimplify.c (gimplify_init_constructor): Do not leave + non-GIMPLE vector constructors around. + * tree-cfg.c (verify_gimple_assign_single): Verify that + CONSTRUCTORs have gimple elements. + 2014-09-22 Jakub Jelinek PR debug/63328 diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 0ebc24c..5933dd2 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -4021,12 +4021,6 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, break; } - /* Don't reduce an initializer constant even if we can't - make a VECTOR_CST. It won't do anything for us, and it'll - prevent us from representing it as a single constant. */ - if (initializer_constant_valid_p (ctor, type)) - break; - TREE_CONSTANT (ctor) = 0; } diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index e89d76a..e88842a 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -4207,8 +4207,20 @@ verify_gimple_assign_single (gimple stmt) debug_generic_stmt (rhs1); return true; } + if (!is_gimple_val (elt_v)) + { + error ("vector CONSTRUCTOR element is not a GIMPLE value"); + debug_generic_stmt (rhs1); + return true; + } } } + else if (CONSTRUCTOR_NELTS (rhs1) != 0) + { + error ("non-vector CONSTRUCTOR with elements"); + debug_generic_stmt (rhs1); + return true; + } return res; case OBJ_TYPE_REF: case ASSERT_EXPR: -- 2.7.4