]> git.ipfire.org Git - thirdparty/gcc.git/commit
c: Fix constructor bounds checking for VLA and construct VLA vector constants
authorTejas Belagod <tejas.belagod@arm.com>
Thu, 5 Sep 2024 09:18:18 +0000 (14:48 +0530)
committerTejas Belagod <tejas.belagod@arm.com>
Fri, 29 Nov 2024 11:33:19 +0000 (17:03 +0530)
commit17b520a10cdaabbcbaeaf30fc5228986b368ce0c
tree53fbde5d9ad6a2739fec3f38932d42778b963dd4
parent4f593db8803cc8df796314ca9e15a72c51d6bde9
c: Fix constructor bounds checking for VLA and construct VLA vector constants

This patch adds support for checking bounds of SVE ACLE vector initialization
constructors.  It also adds support to construct vector constant from init
constructors.

gcc/c/ChangeLog:

* c-typeck.cc (process_init_element): Add check to restrict
constructor length to the minimum vector length allowed.

gcc/ChangeLog:

* tree.cc (build_vector_from_ctor): Add support to construct VLA vector
constants from init constructors.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/sve/acle/general-c/sizeless-1.c: Update test to
test initialize error.
* gcc.target/aarch64/sve/acle/general-c/sizeless-2.c: Likewise.
gcc/c/c-typeck.cc
gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/sizeless-1.c
gcc/testsuite/gcc.target/aarch64/sve/acle/general-c/sizeless-2.c
gcc/tree.cc