diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2020-03-17 09:26:08 +0000 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@linaro.org> | 2020-03-17 09:45:35 +0000 |
commit | fd857de80705be937d9780dbd394d006151713fe (patch) | |
tree | 8adeb3366cbadd565584dbc8224670a26d7981cf /gcc/c | |
parent | 741ff2a263fe0ddc343288331c0047c1a32af8b2 (diff) |
c: ignore initializers for elements of variable-size types [PR93577]
2020-03-17 Christophe Lyon <christophe.lyon@linaro.org>
gcc/
* c-typeck.c (process_init_element): Handle constructor_type with
type size represented by POLY_INT_CST.
gcc/testsuite/
* gcc.target/aarch64/sve/acle/general-c/sizeless-1.c: Remove
superfluous dg-error.
* gcc.target/aarch64/sve/acle/general-c/sizeless-2.c: Likewise.
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/c-typeck.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index d8025de1996..490d8fc5f4a 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -9968,7 +9968,7 @@ process_init_element (location_t loc, struct c_expr value, bool implicit, /* Ignore elements of an initializer for a variable-size type. Those are diagnosed in digest_init. */ if (COMPLETE_TYPE_P (constructor_type) - && TREE_CODE (TYPE_SIZE (constructor_type)) != INTEGER_CST) + && !poly_int_tree_p (TYPE_SIZE (constructor_type))) return; if (!implicit && warn_designated_init && !was_designated |