Re: [PATCH] tree-optimization/105726 - adjust array bound heuristic

2022-05-25 Thread Martin Sebor via Gcc-patches
On 5/25/22 11:19, Martin Sebor wrote: On 5/25/22 04:49, Richard Biener wrote: ... [*] For example, no warning is issued for the following overread: Scratch that, there is no overread with strncpy. When there is like with memcpy, it is diagnosed as it should be. struct A a; void g (char *

Re: [PATCH] tree-optimization/105726 - adjust array bound heuristic

2022-05-25 Thread Martin Sebor via Gcc-patches
On 5/25/22 04:49, Richard Biener wrote: There's heuristic to detect ptr[1].a[...] out of bound accesses reasoning that if ptr points to an array of aggregates a trailing incomplete array has to have size zero. The following more thoroughly constrains the cases this applies to avoid false positiv

[PATCH] tree-optimization/105726 - adjust array bound heuristic

2022-05-25 Thread Richard Biener via Gcc-patches
There's heuristic to detect ptr[1].a[...] out of bound accesses reasoning that if ptr points to an array of aggregates a trailing incomplete array has to have size zero. The following more thoroughly constrains the cases this applies to avoid false positive diagnostics. Bootstrapped and tested on