public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [V5][PATCH 0/2] Handle component_ref to a structure/union field including FAM for builtin_object_size
@ 2023-03-16 21:47 Qing Zhao
  2023-03-16 21:47 ` [V5][PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832] Qing Zhao
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Qing Zhao @ 2023-03-16 21:47 UTC (permalink / raw)
  To: joseph, jakub, sandra
  Cc: rguenther, siddhesh, keescook, gcc-patches, Qing Zhao

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 2230 bytes --]

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


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2023-03-27 17:29 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-16 21:47 [V5][PATCH 0/2] Handle component_ref to a structure/union field including FAM for builtin_object_size Qing Zhao
2023-03-16 21:47 ` [V5][PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832] Qing Zhao
2023-03-23 13:03   ` Fwd: " Qing Zhao
2023-03-23 18:55     ` Joseph Myers
2023-03-27 13:31       ` Qing Zhao
2023-03-27 14:22     ` Qing Zhao
2023-03-16 21:47 ` [V5][PATCH 2/2] Update documentation to clarify a GCC extension Qing Zhao
2023-03-23 13:05   ` Fwd: " Qing Zhao
2023-03-23 20:14     ` Joseph Myers
2023-03-27 13:38       ` Qing Zhao
2023-03-27 14:34         ` Xi Ruoyao
2023-03-27 15:37           ` Qing Zhao
2023-03-27 15:43         ` Jakub Jelinek
2023-03-27 15:57           ` Qing Zhao
2023-03-27 16:06             ` Jakub Jelinek
2023-03-27 16:22               ` Qing Zhao
2023-03-27 16:31                 ` Jakub Jelinek
2023-03-27 16:48                   ` Qing Zhao
2023-03-27 17:29                     ` Qing Zhao
2023-03-23 13:02 ` Fwd: [V5][PATCH 0/2] Handle component_ref to a structure/union field including FAM for builtin_object_size Qing Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).