Re: [PATCH] ubsan: Honor -fstrict-flex-arrays= in -fsanitize=bounds [PR108894]

2023-03-01 Thread Qing Zhao via Gcc-patches
> On Feb 28, 2023, at 4:59 PM, Jakub Jelinek wrote: > > On Tue, Feb 28, 2023 at 07:19:40PM +, Qing Zhao wrote: >> Understood. >> So, your patch fixed this bug, and then [0] arrays are instrumented by >> default with this patch. >> >>> Well, it would complain about >>> struct S { int a;

Re: [PATCH] ubsan: Honor -fstrict-flex-arrays= in -fsanitize=bounds [PR108894]

2023-02-28 Thread Jakub Jelinek via Gcc-patches
On Tue, Feb 28, 2023 at 07:19:40PM +, Qing Zhao wrote: > Understood. > So, your patch fixed this bug, and then [0] arrays are instrumented by > default with this patch. > > > Well, it would complain about > > struct S { int a; int b[0]; int c; } s; > > ... &s.b[1] ... > > for C++, but not f

Re: [PATCH] ubsan: Honor -fstrict-flex-arrays= in -fsanitize=bounds [PR108894]

2023-02-28 Thread Qing Zhao via Gcc-patches
> On Feb 28, 2023, at 12:49 PM, Jakub Jelinek wrote: > > On Tue, Feb 28, 2023 at 04:13:28PM +, Qing Zhao wrote: >>> On Feb 28, 2023, at 3:26 AM, Jakub Jelinek via Gcc-patches >>> wrote: >>> I think -fstrict-flex-arrays* options can be considered as language >>> mode changing options, by d

Re: [PATCH] ubsan: Honor -fstrict-flex-arrays= in -fsanitize=bounds [PR108894]

2023-02-28 Thread Jakub Jelinek via Gcc-patches
On Tue, Feb 28, 2023 at 04:13:28PM +, Qing Zhao wrote: > > On Feb 28, 2023, at 3:26 AM, Jakub Jelinek via Gcc-patches > > wrote: > > I think -fstrict-flex-arrays* options can be considered as language > > mode changing options, by default flexible member-like arrays are > > handled like flexi

Re: [PATCH] ubsan: Honor -fstrict-flex-arrays= in -fsanitize=bounds [PR108894]

2023-02-28 Thread Qing Zhao via Gcc-patches
Hi, Jakub, Thanks a lot for fixing this issue. I have several questions in below: > On Feb 28, 2023, at 3:26 AM, Jakub Jelinek via Gcc-patches > wrote: > I think -fstrict-flex-arrays* options can be considered as language > mode changing options, by default flexible member-like arrays are > ha

Re: [PATCH] ubsan: Honor -fstrict-flex-arrays= in -fsanitize=bounds [PR108894]

2023-02-28 Thread Jakub Jelinek via Gcc-patches
On Tue, Feb 28, 2023 at 09:02:47AM +, Richard Biener wrote: > > While this isn't really a regression, the -fstrict-flex-arrays* > > option is new in GCC 13 and so I think we should make -fsanitize=bounds > > play with it well from the beginning. > > > > The current behavior is that -fsanitize=

Re: [PATCH] ubsan: Honor -fstrict-flex-arrays= in -fsanitize=bounds [PR108894]

2023-02-28 Thread Richard Biener via Gcc-patches
On Tue, 28 Feb 2023, Jakub Jelinek wrote: > Hi! > > While this isn't really a regression, the -fstrict-flex-arrays* > option is new in GCC 13 and so I think we should make -fsanitize=bounds > play with it well from the beginning. > > The current behavior is that -fsanitize=bounds considers all t

[PATCH] ubsan: Honor -fstrict-flex-arrays= in -fsanitize=bounds [PR108894]

2023-02-28 Thread Jakub Jelinek via Gcc-patches
Hi! While this isn't really a regression, the -fstrict-flex-arrays* option is new in GCC 13 and so I think we should make -fsanitize=bounds play with it well from the beginning. The current behavior is that -fsanitize=bounds considers all trailing arrays as flexible member-like arrays and both -f