public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/2] More condition coverage fixes
@ 2024-04-08 14:18 Jørgen Kvalsvik
  2024-04-08 14:18 ` [PATCH 1/2] Add tree-inlined gconds to caller cond->expr map Jørgen Kvalsvik
  2024-04-08 14:18 ` [PATCH 2/2] Generate constant at start of loop, without UB Jørgen Kvalsvik
  0 siblings, 2 replies; 6+ messages in thread
From: Jørgen Kvalsvik @ 2024-04-08 14:18 UTC (permalink / raw)
  To: gcc-patches; +Cc: hjl.tools, rguenther, hubicka, sam, Jørgen Kvalsvik

Here are two more patches for the condition coverage.

Inlined conditions are actually counted this time, as the recorded
expression mapping uses the new, deep-copied gconds as keys and not the
pointers from the source function.

The reported UB is gone when the number of conditions are exactly 64
(sizeof uint64_t), by slightly restructuring the loop generating
constants.

This passes check-gcc RUNTESTFLAGS=gcov.exp in my ubsan instrumented
build:

configure --enable-languages=c,c++ --enable-host-shared
--enable-checking=release --disable-multilib
--with-build-config=bootstrap-ubsan

Jørgen Kvalsvik (2):
  Add tree-inlined gconds to caller cond->expr map
  Generate constant at start of loop, without UB

 gcc/testsuite/gcc.misc-tests/gcov-19.c | 37 ++++++++++++++++++++++
 gcc/tree-inline.cc                     | 43 ++++++++++++++------------
 gcc/tree-profile.cc                    | 20 +++++++++---
 3 files changed, 76 insertions(+), 24 deletions(-)

-- 
2.30.2


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

end of thread, other threads:[~2024-04-09  7:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-08 14:18 [PATCH 0/2] More condition coverage fixes Jørgen Kvalsvik
2024-04-08 14:18 ` [PATCH 1/2] Add tree-inlined gconds to caller cond->expr map Jørgen Kvalsvik
2024-04-09  7:40   ` Richard Biener
2024-04-08 14:18 ` [PATCH 2/2] Generate constant at start of loop, without UB Jørgen Kvalsvik
2024-04-09  7:40   ` Richard Biener
2024-04-09  7:58     ` Jørgen Kvalsvik

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