diff options
Diffstat (limited to 'contrib/gcc/c-typeck.c')
-rw-r--r-- | contrib/gcc/c-typeck.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/gcc/c-typeck.c b/contrib/gcc/c-typeck.c index 21cc510..5bf72fe 100644 --- a/contrib/gcc/c-typeck.c +++ b/contrib/gcc/c-typeck.c @@ -4759,6 +4759,14 @@ digest_init (type, init, require_constant) return inside_init; } } + /* Build a VECTOR_CST from a *constant* vector constructor. If the + vector constructor is not constant (e.g. {1,2,3,foo()}) then punt + below and handle as a constructor. */ + if (code == VECTOR_TYPE + && comptypes (TREE_TYPE (inside_init), type) + && TREE_CONSTANT (inside_init)) + return build_vector (type, TREE_OPERAND (inside_init, 1)); + /* Any type can be initialized from an expression of the same type, optionally with braces. */ |