public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/2] __bos and flex arrays
@ 2022-12-21 22:25 Siddhesh Poyarekar
  2022-12-21 22:25 ` [PATCH 1/2] testsuite: Run __bos tests to completion Siddhesh Poyarekar
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Siddhesh Poyarekar @ 2022-12-21 22:25 UTC (permalink / raw)
  To: gcc-patches; +Cc: jakub

Hi,

The first patch in the series is just a minor test cleanup that I did to
make sure all tests in a test case run (instead of aborting at first
failure) and print the ones that failed.  The second patch is the actual
fix.

The patch intends to make __bos/__bdos do the right thing with structs
containing flex arrays, either directly or within nested structs and
unions.  This should improve minimum object size estimation in some
cases and also bail out more consistently so that flex arrays don't
cause false positives in fortification.

I've tested this with a bootstrap on x86_64 and also with
--with-build-config=bootstrap-ubsan to make sure that there are no new
failures due to this change.

Siddhesh Poyarekar (2):
  testsuite: Run __bos tests to completion
  tree-object-size: More consistent behaviour with flex arrays

 .../g++.dg/ext/builtin-object-size1.C         | 267 ++++++++--------
 .../g++.dg/ext/builtin-object-size2.C         | 267 ++++++++--------
 .../gcc.dg/builtin-dynamic-object-size-0.c    |  14 +-
 gcc/testsuite/gcc.dg/builtin-object-size-1.c  | 263 ++++++++--------
 gcc/testsuite/gcc.dg/builtin-object-size-12.c |  12 +-
 gcc/testsuite/gcc.dg/builtin-object-size-13.c |  17 +-
 gcc/testsuite/gcc.dg/builtin-object-size-15.c |  11 +-
 gcc/testsuite/gcc.dg/builtin-object-size-2.c  | 287 +++++++++---------
 gcc/testsuite/gcc.dg/builtin-object-size-3.c  | 263 ++++++++--------
 gcc/testsuite/gcc.dg/builtin-object-size-4.c  | 267 ++++++++--------
 gcc/testsuite/gcc.dg/builtin-object-size-6.c  | 267 ++++++++--------
 gcc/testsuite/gcc.dg/builtin-object-size-7.c  |  52 ++--
 gcc/testsuite/gcc.dg/builtin-object-size-8.c  |  17 +-
 .../gcc.dg/builtin-object-size-common.h       |  12 +
 .../gcc.dg/builtin-object-size-flex-common.h  |  90 ++++++
 ...n-object-size-flex-nested-struct-nonzero.c |   6 +
 ...ltin-object-size-flex-nested-struct-zero.c |   6 +
 .../builtin-object-size-flex-nested-struct.c  |  22 ++
 ...in-object-size-flex-nested-union-nonzero.c |   6 +
 ...iltin-object-size-flex-nested-union-zero.c |   6 +
 .../builtin-object-size-flex-nested-union.c   |  28 ++
 .../gcc.dg/builtin-object-size-flex-nonzero.c |   6 +
 .../gcc.dg/builtin-object-size-flex-zero.c    |   6 +
 .../gcc.dg/builtin-object-size-flex.c         |  18 ++
 gcc/testsuite/gcc.dg/pr101836.c               |  11 +-
 gcc/testsuite/gcc.dg/strict-flex-array-3.c    |  11 +-
 gcc/tree-object-size.cc                       | 150 ++++-----
 27 files changed, 1275 insertions(+), 1107 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-common.h
 create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-flex-common.h
 create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-flex-nested-struct-nonzero.c
 create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-flex-nested-struct-zero.c
 create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-flex-nested-struct.c
 create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-flex-nested-union-nonzero.c
 create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-flex-nested-union-zero.c
 create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-flex-nested-union.c
 create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-flex-nonzero.c
 create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-flex-zero.c
 create mode 100644 gcc/testsuite/gcc.dg/builtin-object-size-flex.c

-- 
2.38.1


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

end of thread, other threads:[~2023-02-01 16:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-21 22:25 [PATCH 0/2] __bos and flex arrays Siddhesh Poyarekar
2022-12-21 22:25 ` [PATCH 1/2] testsuite: Run __bos tests to completion Siddhesh Poyarekar
2023-01-31 12:33   ` Jakub Jelinek
2023-02-01 16:46     ` [committed v2] " Siddhesh Poyarekar
2022-12-21 22:25 ` [PATCH 2/2] tree-object-size: More consistent behaviour with flex arrays Siddhesh Poyarekar
2023-01-26 16:20   ` Qing Zhao
2023-01-26 17:16     ` Siddhesh Poyarekar
2023-01-26 17:42       ` Qing Zhao
2023-01-31 12:46   ` Jakub Jelinek
2023-01-31 13:01     ` Siddhesh Poyarekar
2023-01-03 14:30 ` [ping][PATCH 0/2] __bos and " Siddhesh Poyarekar
2023-01-11 13:14 ` [ping2][PATCH " Siddhesh Poyarekar
2023-01-20 19:38 ` [ping3][PATCH " Siddhesh Poyarekar

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).