[PATCH] D144136: Add a "remark" to report on array accesses

2023-09-27 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. The GitHub repo with this and the `counted_by` change: https://github.com/bwendling/llvm-project/tree/array-bounds-remarks-with-counted-by Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144136/new/ https://reviews.llvm.org/D14

[PATCH] D144136: Add a "remark" to report on array accesses

2023-09-26 Thread Kees Cook via Phabricator via cfe-commits
kees added a comment. In D144136#4651030 , @void wrote: > or can it be simplified into something like this: > > array-bounds.c:341:2: remark: accessing flexible array, counted by 'count', > with 'index - 1' [-Rarray-bounds] > 341 | TEST_AC

[PATCH] D144136: Add a "remark" to report on array accesses

2023-09-26 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. In D144136#4639907 , @kees wrote: > Can you refresh this patch to work with https://reviews.llvm.org/D148381 ? My > testing seems to imply that it doesn't know the size of the array. I assume > the `if (!IsUnboundedArray)` check is

[PATCH] D144136: Add a "remark" to report on array accesses

2023-09-06 Thread Kees Cook via Phabricator via cfe-commits
kees added a comment. Can you refresh this patch to work with https://reviews.llvm.org/D148381 ? My testing seems to imply that it doesn't know the size of the array. I assume the `if (!IsUnboundedArray)` check is incomplete now. i.e. for a `__counted_by` array, I see the "unknown" remark: a

[PATCH] D144136: Add a "remark" to report on array accesses

2023-03-06 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 502766. void added a comment. Slight typo Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144136/new/ https://reviews.llvm.org/D144136 Files: clang/include/clang/Basic/DiagnosticGroups.td clang/include/clang/Ba

[PATCH] D144136: Add a "remark" to report on array accesses

2023-03-06 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 502760. void added a comment. Revise with Kees's code. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144136/new/ https://reviews.llvm.org/D144136 Files: clang/include/clang/Basic/DiagnosticGroups.td clang/inc

[PATCH] D144136: Add a "remark" to report on array accesses

2023-02-23 Thread Kees Cook via Phabricator via cfe-commits
kees added a comment. This gets me all 6 reports. The details about the array and the index don't really matter for the basic metrics: diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/Diagnostic SemaKinds.td index ba831c026342..29d2167b504b 100644

[PATCH] D144136: Add a "remark" to report on array accesses

2023-02-21 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 499321. void added a comment. Report when there's a non-constant access: array_access_report.c:32:17: remark: accessing fixed sized array 'int[16]' by 'index' [-Rarray-bounds] report_size(p->array, index); ^ Repository: rG LLVM Github Monor

[PATCH] D144136: Add a "remark" to report on array accesses

2023-02-21 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. In D144136#4137143 , @kees wrote: > Here's a test-case. I'd expect 6 remarks from building this: > > /* Build with -Wall -O2 -fstrict-flex-arrays=3 -fsanitize=bounds > -Rarray-bounds */ > #include > #include > #include >

[PATCH] D144136: Add a "remark" to report on array accesses

2023-02-18 Thread Kees Cook via Phabricator via cfe-commits
kees added a comment. Here's a test-case. I'd expect 6 remarks from building this: /* Build with -Wall -O2 -fstrict-flex-arrays=3 -fsanitize=bounds -Rarray-bounds */ #include #include #include #include #define report_size(p, index) do {\ const size_t bdos = __bu

[PATCH] D144136: Add a "remark" to report on array accesses

2023-02-18 Thread Kees Cook via Phabricator via cfe-commits
kees added a comment. This appears to be working for me. For before/after changes, the other half is still needed, i.e. a "accessing array of unknown size" and eventually splitting the dynamic sizing check off of that one (once -fsanitize=bounds checks __builtin_dynamic_object_size). For examp

[PATCH] D144136: Add a "remark" to report on array accesses

2023-02-16 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. In D144136#4131825 , @aaron.ballman wrote: > I'd like to understand what the overhead is for this. How much overhead does > this add when the remark is disabled? How much overhead does this add when > the remark is enabled? > >> T

[PATCH] D144136: Add a "remark" to report on array accesses

2023-02-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. I'd like to understand what the overhead is for this. How much overhead does this add when the remark is disabled? How much overhead does this add when the remark is enabled? > This will report a ton of information. It's basically only good for piping to > a file

[PATCH] D144136: Add a "remark" to report on array accesses

2023-02-15 Thread Kees Cook via Phabricator via cfe-commits
kees added a comment. This information will be useful for evaluating the coverage of the bounds checker for a given program, which in turn can help guide both improvements to the bounds checker (e.g. adding knowledge from `__builtin_dynamic_object_size()`) and improvements to the built code bas

[PATCH] D144136: Add a "remark" to report on array accesses

2023-02-15 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. What would the information be useful for? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144136/new/ https://reviews.llvm.org/D144136 ___ cfe-commits mailing list cfe-commits@list

[PATCH] D144136: Add a "remark" to report on array accesses

2023-02-15 Thread Bill Wendling via Phabricator via cfe-commits
void created this revision. Herald added a project: All. void requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This will report a ton of information. It's basically only good for piping to a file and using Perl to gather any useful informati