diff options
author | Qing Zhao <qing.zhao@oracle.com> | 2023-01-13 15:08:00 +0000 |
---|---|---|
committer | Qing Zhao <qing.zhao@oracle.com> | 2023-01-13 15:08:00 +0000 |
commit | a3e8727b70f546dc82941391f3951188a0339e08 (patch) | |
tree | e5373b5b514284f10344daf67a0c693c44c26d38 /gcc/common | |
parent | 450eb6b3b5b544d26da2535228ce03f9656a13a5 (diff) | |
download | gcc-a3e8727b70f546dc82941391f3951188a0339e08.zip gcc-a3e8727b70f546dc82941391f3951188a0339e08.tar.gz gcc-a3e8727b70f546dc82941391f3951188a0339e08.tar.bz2 |
Replace flag_strict_flex_arrays with DECL_NOT_FLEXARRAY in middle-end.
We should not directly check flag_strict_flex_arrays in the
middle end. Instead, check DECL_NOT_FLEXARRAY(array_field_decl) which is set
by C/C++ FEs according to -fstrict-flex-arrays and the corresponding
attribute attached to the array_field.
As a result, We will lose the LEVEL information of -fstrict-flex-arrays in
the middle end. -Wstrict-flex-arrays will not be able to issue such
information. update the testing cases accordingly.
gcc/ChangeLog:
* attribs.cc (strict_flex_array_level_of): Move this function to ...
* attribs.h (strict_flex_array_level_of): Remove the declaration.
* gimple-array-bounds.cc (array_bounds_checker::check_array_ref):
replace the referece to strict_flex_array_level_of with
DECL_NOT_FLEXARRAY.
* tree.cc (component_ref_size): Likewise.
gcc/c/ChangeLog:
* c-decl.cc (strict_flex_array_level_of): ... here.
gcc/testsuite/ChangeLog:
* gcc.dg/Warray-bounds-flex-arrays-1.c: Delete the level information
from the message issued by -Wstrict-flex-arrays.
* gcc.dg/Warray-bounds-flex-arrays-2.c: Likewise.
* gcc.dg/Warray-bounds-flex-arrays-3.c: Likewise.
* gcc.dg/Warray-bounds-flex-arrays-4.c: Likewise.
* gcc.dg/Warray-bounds-flex-arrays-5.c: Likewise.
* gcc.dg/Warray-bounds-flex-arrays-6.c: Likewise.
* gcc.dg/Wstrict-flex-arrays-2.c: Likewise.
* gcc.dg/Wstrict-flex-arrays-3.c: Likewise.
* gcc.dg/Wstrict-flex-arrays.c: Likewise.
Diffstat (limited to 'gcc/common')
0 files changed, 0 insertions, 0 deletions