Hi, Joseph, Jakub and Sandra, Could you please review this patch and let me know whether it???s ready for committing into GCC13?
The fix to Bug PR101832 is an important patch for kernel security purpose. it's better to be put into GCC13. =========================================== These are the 5th version of the patches for PR101832, to fix builtin_object_size to correctly handle component_ref to a structure/union field that includes a flexible array member. also includes a documentation update for the GCC extension on embedding a structure/union with flexible array member into another structure. which includes a fix to PR77650. compared to the 4th version of the patch, the major changes are: 1. Update the documentation per Sandra's comments and suggestion. 2. per Richard's suggestion, let the new bit TYPE_INCLUDE_FLEXARRAY to share the same bit with no_named_args_stdarg_p to save space in the IR. and corresponding changes to support such sharing. 3. I also changed the code inside tree-object-size.cc to make it cleaner and easier to be understood. bootstrapped and regression tested on aarch64 and x86. Okay for commit? thanks. Qing Qing Zhao (2): Handle component_ref to a structre/union field including flexible array member [PR101832] Update documentation to clarify a GCC extension gcc/c-family/c.opt | 5 + gcc/c/c-decl.cc | 19 +++ gcc/doc/extend.texi | 45 +++++- gcc/lto/lto-common.cc | 5 +- gcc/print-tree.cc | 5 + .../gcc.dg/builtin-object-size-pr101832.c | 134 ++++++++++++++++++ .../gcc.dg/variable-sized-type-flex-array.c | 31 ++++ gcc/tree-core.h | 2 + gcc/tree-object-size.cc | 23 ++- gcc/tree-streamer-in.cc | 5 +- gcc/tree-streamer-out.cc | 5 +- gcc/tree.h | 7 +- 12 files changed, 280 insertions(+), 6 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-pr101832.c create mode 100644 gcc/testsuite/gcc.dg/variable-sized-type-flex-array.c -- 2.31.1