Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Qing Zhao via Gcc-patches
Thanks a lot for the info. Qing > On Mar 20, 2023, at 6:25 PM, Jakub Jelinek wrote: > > On Mon, Mar 20, 2023 at 10:05:57PM +0000, Qing Zhao via Gcc-patches wrote: >> My question: is the above section the place in C standard “explicitly allows >> contractions”? If

Re: Should -ffp-contract=off the default on GCC?

2023-03-20 Thread Qing Zhao via Gcc-patches
Hi, > On Mar 16, 2023, at 12:53 PM, Jakub Jelinek wrote: > > On Thu, Mar 16, 2023 at 04:38:41PM +0000, Qing Zhao via Gcc-patches wrote: >>> NO. We have this debate every few years and such. >> >> So, what’s the major reason we keep the default that is

[V5][PATCH 2/2] Update documentation to clarify a GCC extension

2023-03-16 Thread Qing Zhao via Gcc-patches
on a structure with a C99 flexible array member being nested in another structure. (PR77650) "GCC extension accepts a structure containing an ISO C99 "flexible array member", or a union containing such a structure (possibly recursively) to be a member of a structure. There are two situations:

[V5][PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-03-16 Thread Qing Zhao via Gcc-patches
GCC extension accepts the case when a struct with a flexible array member is embedded into another struct or union (possibly recursively). __builtin_object_size should treat such struct as flexible size per -fstrict-flex-arrays. gcc/c/ChangeLog: PR tree-optimization/101832 *

[V5][PATCH 0/2] Handle component_ref to a structure/union field including FAM for builtin_object_size

2023-03-16 Thread Qing Zhao via Gcc-patches
to save space in the IR. and corresponding changes to support such sharing. 3. I also changed the code inside tree-object-size.cc to make it cleaner and easier to be understood. bootstrapped and regression tested on aarch64 and x86. Okay for commit? thanks. Qing Qing Zhao (2): Handle

Re: Should -ffp-contract=off the default on GCC?

2023-03-16 Thread Qing Zhao via Gcc-patches
> On Mar 16, 2023, at 12:53 PM, Jakub Jelinek wrote: > > On Thu, Mar 16, 2023 at 04:38:41PM +0000, Qing Zhao via Gcc-patches wrote: >>> NO. We have this debate every few years and such. >> >> So, what’s the major reason we keep the default that is not IEEE754 &

Re: Should -ffp-contract=off the default on GCC?

2023-03-16 Thread Qing Zhao via Gcc-patches
> On Mar 16, 2023, at 12:31 PM, Andrew Pinski wrote: > > On Thu, Mar 16, 2023 at 9:25 AM Qing Zhao via Gcc-patches > wrote: >> >> Hi, >> >> Recently, we discovered some floating point precision diffs when using GCC8 >> to build our >>

Should -ffp-contract=off the default on GCC?

2023-03-16 Thread Qing Zhao via Gcc-patches
Hi, Recently, we discovered some floating point precision diffs when using GCC8 to build our application on arm64: After some investigation, it turns out that this is due to the -ffp-contract=fast option that is on by default. Therefore, we have to explicitly add -ffp-contract=off and do a

Re: [V4][PATCH 2/2] Update documentation to clarify a GCC extension

2023-03-15 Thread Qing Zhao via Gcc-patches
we can completely delete this case from GCC support. Right now, GCC’s implementation cannot handle such case consistently. So, how to document this case is really hard. > On Mar 14, 2023, at 11:26 PM, Sandra Loosemore > wrote: > > On 2/24/23 11:35, Qing Zhao via Gcc-patches wrote:

Re: [v4][PATCH 1/2] Handle component_ref to a structre/union field including C99 FAM [PR101832]

2023-03-14 Thread Qing Zhao via Gcc-patches
> On Mar 14, 2023, at 5:04 AM, Richard Biener wrote: > > On Mon, 13 Mar 2023, Qing Zhao wrote: > >> Hi, Richard, >> >> Do you have more comments on my responds to your previous questions? > > No, generally we're not good at naming the shared bits, so

Re: [v4][PATCH 1/2] Handle component_ref to a structre/union field including C99 FAM [PR101832]

2023-03-13 Thread Qing Zhao via Gcc-patches
Hi, Richard, Do you have more comments on my responds to your previous questions? thanks. Qing > On Mar 10, 2023, at 8:48 AM, Qing Zhao via Gcc-patches > wrote: > > > >> On Mar 10, 2023, at 2:54 AM, Richard Biener wrote: >> >> On

Re: [V4][PATCH 2/2] Update documentation to clarify a GCC extension

2023-03-13 Thread Qing Zhao via Gcc-patches
> On Mar 12, 2023, at 7:14 PM, Sandra Loosemore wrote: > > On 3/2/23 17:03, Qing Zhao via Gcc-patches wrote: >> Ping. > > It looks to me like there is an associated code patch (for PR101832) that is > still under technical discussion? Yes, the 1st patch in

Re: [v4][PATCH 1/2] Handle component_ref to a structre/union field including C99 FAM [PR101832]

2023-03-10 Thread Qing Zhao via Gcc-patches
> On Mar 10, 2023, at 2:54 AM, Richard Biener wrote: > > On Thu, 9 Mar 2023, Qing Zhao wrote: > >> >> >>> On Mar 9, 2023, at 7:20 AM, Richard Biener wrote: >>> >>> On Fri, 24 Feb 2023, Qing Zhao wrote: >>> >>>>

Re: [v4][PATCH 1/2] Handle component_ref to a structre/union field including C99 FAM [PR101832]

2023-03-09 Thread Qing Zhao via Gcc-patches
> On Mar 9, 2023, at 7:20 AM, Richard Biener wrote: > > On Fri, 24 Feb 2023, Qing Zhao wrote: > >> GCC extension accepts the case when a struct with a C99 flexible array member >> is embedded into another struct or union (possibly recursively). >> __bu

Re: HELP: Questions on multiple PROGRAM_SUMMARY sections in a profiling data file

2023-03-08 Thread Qing Zhao via Gcc-patches
Honza, Thanks a lot for your information. > On Mar 8, 2023, at 8:19 AM, Jan Hubicka wrote: > >> Hi, Jan, >> >> I am studying one profiling feedback ICE bug with GCC8 recently. >> It’s an assertion failure inside the routine “compute_working_sets”of >> gcov-io.c: >> >>

HELP: Questions on multiple PROGRAM_SUMMARY sections in a profiling data file

2023-03-07 Thread Qing Zhao via Gcc-patches
Hi, Jan, I am studying one profiling feedback ICE bug with GCC8 recently. It’s an assertion failure inside the routine “compute_working_sets”of gcov-io.c: gcov_nonruntime_assert (ws_ix == NUM_GCOV_WORKING_SETS); After some debugging and study, I found that the corresponding .gcda file has two

Re: [V4][PATCH 2/2] Update documentation to clarify a GCC extension

2023-03-02 Thread Qing Zhao via Gcc-patches
Ping. Qing > On Feb 24, 2023, at 1:35 PM, Qing Zhao wrote: > > on a structure with a C99 flexible array member being nested in > another structure. > > "GCC extension accepts a structure containing an ISO C99 "flexible array > member", or a union c

Re: [v4][PATCH 1/2] Handle component_ref to a structre/union field including C99 FAM [PR101832]

2023-03-02 Thread Qing Zhao via Gcc-patches
Ping. Qing > On Feb 24, 2023, at 1:35 PM, Qing Zhao wrote: > > GCC extension accepts the case when a struct with a C99 flexible array member > is embedded into another struct or union (possibly recursively). > __builtin_object_size should treat such struct as flexible s

Re: [V4][PATCH 0/2] Handle component_ref to a structure/union field including FAM for builtin_object_size

2023-03-02 Thread Qing Zhao via Gcc-patches
Ping Qing > On Feb 24, 2023, at 1:35 PM, Qing Zhao wrote: > > Hi, Joseph and Richard, > > Could you please review this patch and let me know whether it’s ready > for committing into GCC13? > > The fix to Bug PR101832 is an important patch for kernel security > pur

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 +0000, Qing Zhao wrote: >> Understood. >> So, your patch fixed this bug, and then [0] arrays are instrumented by >> default with this patch. >> >>> Well,

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 +0000, 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 a

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 >

Fwd: [V2][PATCH] Fixing PR107411

2023-02-27 Thread Qing Zhao via Gcc-patches
Ping. Qing Begin forwarded message: From: Qing Zhao mailto:qing.z...@oracle.com>> Subject: [V2][PATCH] Fixing PR107411 Date: February 21, 2023 at 9:46:04 AM EST To: ja...@redhat.com<mailto:ja...@redhat.com>, rguent...@suse.de<mailto:rguent...@suse.de> Cc: gcc-patches@gcc.

[V4][PATCH 2/2] Update documentation to clarify a GCC extension

2023-02-24 Thread Qing Zhao via Gcc-patches
on a structure with a C99 flexible array member being nested in another structure. "GCC extension accepts a structure containing an ISO C99 "flexible array member", or a union containing such a structure (possibly recursively) to be a member of a structure. There are two situations: * The

[v4][PATCH 1/2] Handle component_ref to a structre/union field including C99 FAM [PR101832]

2023-02-24 Thread Qing Zhao via Gcc-patches
GCC extension accepts the case when a struct with a C99 flexible array member is embedded into another struct or union (possibly recursively). __builtin_object_size should treat such struct as flexible size. gcc/c/ChangeLog: PR tree-optimization/101832 * c-decl.cc

[V4][PATCH 0/2] Handle component_ref to a structure/union field including FAM for builtin_object_size

2023-02-24 Thread Qing Zhao via Gcc-patches
of another structure. 5. add a new warning option -Wgnu-variable-sized-type-not-at-end for identifing all such cases. bootstrapped and regression tested on aarch64 and x86. Okay for commit? thanks. Qing Qing Zhao (2): Handle component_ref to a structre/union field including C99 FAM [PR101832

Re: [v3][PATCH 2/2] Update documentation to clarify a GCC extension (PR77650)

2023-02-24 Thread Qing Zhao via Gcc-patches
> On Feb 23, 2023, at 7:56 PM, Joseph Myers wrote: > > On Thu, 23 Feb 2023, Qing Zhao via Gcc-patches wrote: > >> But the following: >> >> struct flex1 { int length1; char data1[]; }; >> struct flex2 { int length2; char data2[]; }; >> union uni

Re: [v3][PATCH 2/2] Update documentation to clarify a GCC extension (PR77650)

2023-02-23 Thread Qing Zhao via Gcc-patches
> On Feb 23, 2023, at 5:04 PM, Qing Zhao via Gcc-patches > wrote: > > > >> On Feb 23, 2023, at 4:24 PM, Joseph Myers wrote: >> >> On Thu, 23 Feb 2023, Qing Zhao via Gcc-patches wrote: >> >>> +@item >>> +The structure with a C99

Re: [v3][PATCH 2/2] Update documentation to clarify a GCC extension (PR77650)

2023-02-23 Thread Qing Zhao via Gcc-patches
> On Feb 23, 2023, at 4:24 PM, Joseph Myers wrote: > > On Thu, 23 Feb 2023, Qing Zhao via Gcc-patches wrote: > >> +@item >> +The structure with a C99 flexible array member is the field of >> +another union, for example: >> + >> +@smallexample &g

Fwd: [v3][PATCH 2/2] Update documentation to clarify a GCC extension (PR77650)

2023-02-23 Thread Qing Zhao via Gcc-patches
Ping * 2. Hi, Joseph and Richard, Could you please review this patch and let me know whether it’s ready for committing into GCC13? thanks. Qing Begin forwarded message: From: Qing Zhao mailto:qing.z...@oracle.com>> Subject: [v3][PATCH 2/2] Update documentation to clarify a GCC ext

Fwd: [v3][PATCH 1/2] Handle component_ref to a structre/union field including C99 FAM [PR101832]

2023-02-23 Thread Qing Zhao via Gcc-patches
Ping * 2. Hi, Joseph and Richard, Could you please review this patch and let me know whether it’s ready for committing into GCC13? This is an important bug that need to be fixed for kernel security purpose. thanks. Qing Begin forwarded message: From: Qing Zhao mailto:qing.z...@oracle.com

[V2][PATCH] Fixing PR107411

2023-02-21 Thread Qing Zhao via Gcc-patches
This is the 2nd version of the patch. compared to the first version, the major change is: use sprintf to replace xasprintf per Jacub's suggestion. bootstrapped and regression tested on both x86 and aarch64. Okay for committing? thanks. Qing === This is a bug in

Re: [PATCH] Fixing PR107411

2023-02-20 Thread Qing Zhao via Gcc-patches
> On Feb 20, 2023, at 10:17 AM, Jakub Jelinek wrote: > > On Mon, Feb 20, 2023 at 03:04:51PM +0000, Qing Zhao via Gcc-patches wrote: >> >> >>> On Feb 17, 2023, at 5:35 PM, Jakub Jelinek wrote: >>> >>> On Fri, Feb 17, 2023 at 1

Re: [PATCH] Fixing PR107411

2023-02-20 Thread Qing Zhao via Gcc-patches
> On Feb 17, 2023, at 5:35 PM, Jakub Jelinek wrote: > > On Fri, Feb 17, 2023 at 10:26:03PM +0000, Qing Zhao via Gcc-patches wrote: >> + else if (!DECL_NAME (lhs_var)) >> +{ >> + char *lhs_var_name_str >> += xas

[PATCH] Fixing PR107411

2023-02-17 Thread Qing Zhao via Gcc-patches
This is a bug in tree-ssa-uninit.cc. When doing the following: /* Ignore the call to .DEFERRED_INIT that define the original var itself as the following case: temp = .DEFERRED_INIT (4, 2, “alt_reloc"); alt_reloc = temp; In order to avoid generating warning for the fake

Re: [v3][PATCH 2/2] Update documentation to clarify a GCC extension (PR77650)

2023-02-17 Thread Qing Zhao via Gcc-patches
Ping… Qing > On Feb 10, 2023, at 7:50 PM, Qing Zhao wrote: > > on structure with C99 flexible array member being nested in another structure. > > This is also fixed PR77650. > > " GCC extension accepts a structure containing a ISO C99 "flexible array &

Re: [v3][PATCH 1/2] Handle component_ref to a structre/union field including C99 FAM [PR101832]

2023-02-17 Thread Qing Zhao via Gcc-patches
Ping… Qing > On Feb 10, 2023, at 7:50 PM, Qing Zhao wrote: > > GCC extension accepts the case when a struct with a C99 flexible array member > is embedded into another struct or union (possibly recursively). > __builtin_object_size should treat such struct as flexible s

Re: [v3][PATCH 0/2] Handle component_ref to a structure/union field including FAM for builtin_object_size

2023-02-17 Thread Qing Zhao via Gcc-patches
Ping… Qing > On Feb 10, 2023, at 7:50 PM, Qing Zhao wrote: > > These are the 3rd version of the patches for PR101832, to fix > builtin_object_size to correctly handle component_ref to a > structure/union field that includes a flexible array member. > > also includes a

Re: [PATCH] testsuite: Handle "packed" targets in c-c++-common/auto-init-7.c and -8.c

2023-02-15 Thread Qing Zhao via Gcc-patches
Thank you for fixing this issue. Qing > On Feb 15, 2023, at 2:19 PM, Hans-Peter Nilsson wrote: > > Tested for cris-elf. Ok to commit? > > -- >8 -- > Looks like there's a failed assumption that > sizeof (union U { char u1[5]; int u2; float u3; }) == 8. > However, for "packed" targets like

[v3][PATCH 0/2] Handle component_ref to a structure/union field including FAM for builtin_object_size

2023-02-10 Thread Qing Zhao via Gcc-patches
These are the 3rd version of the patches for PR101832, to fix builtin_object_size to correctly handle component_ref to a structure/union field that includes a flexible array member. also includes a documentation update for the GCC extension on embedding a structure/union with flexible array

[v3][PATCH 2/2] Update documentation to clarify a GCC extension (PR77650)

2023-02-10 Thread Qing Zhao via Gcc-patches
on structure with C99 flexible array member being nested in another structure. This is also fixed PR77650. " GCC extension accepts a structure containing a ISO C99 "flexible array member", or a union containing such a structure (possibly recursively) to be a member of a structure. There are

[v3][PATCH 1/2] Handle component_ref to a structre/union field including C99 FAM [PR101832]

2023-02-10 Thread Qing Zhao via Gcc-patches
GCC extension accepts the case when a struct with a C99 flexible array member is embedded into another struct or union (possibly recursively). __builtin_object_size should treat such struct as flexible size. gcc/c/ChangeLog: PR tree-optimization/101832 * c-decl.cc

Re: [PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-02-10 Thread Qing Zhao via Gcc-patches
Thanks, Kees. If there is no objection, I will update my patches with this. And send the updated patches soon. Qing > On Feb 9, 2023, at 11:46 AM, Kees Cook wrote: > > On Thu, Feb 09, 2023 at 02:40:57PM +0000, Qing Zhao wrote: >> So, the major question here is: >> >

Re: [PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-02-09 Thread Qing Zhao via Gcc-patches
> On Feb 8, 2023, at 6:18 PM, Qing Zhao via Gcc-patches > wrote: > > > >> On Feb 8, 2023, at 2:09 PM, Joseph Myers wrote: >> >> On Wed, 8 Feb 2023, Qing Zhao via Gcc-patches wrote: >> >>> But I noticed that “flexible_array_type_p” l

Re: [PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-02-09 Thread Qing Zhao via Gcc-patches
> On Feb 9, 2023, at 5:35 AM, Richard Biener wrote: > > On Wed, 8 Feb 2023, Qing Zhao wrote: > >> >> >>> On Feb 7, 2023, at 6:37 PM, Joseph Myers wrote: >>> >>> On Tue, 7 Feb 2023, Qing Zhao via Gcc-patches wrote: >>>

Re: [PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-02-08 Thread Qing Zhao via Gcc-patches
> On Feb 8, 2023, at 2:09 PM, Joseph Myers wrote: > > On Wed, 8 Feb 2023, Qing Zhao via Gcc-patches wrote: > >> But I noticed that “flexible_array_type_p” later was moved from FE to >> middle-end and put into tree.cc, tree.h as a general utility routine, and to >

Re: [PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-02-08 Thread Qing Zhao via Gcc-patches
> On Feb 8, 2023, at 2:20 PM, Siddhesh Poyarekar wrote: > > On 2023-02-08 14:09, Joseph Myers wrote: >> What must be avoided is -pedantic diagnostics for >> struct flex1 { int n; int data[1]; }; >> struct out_flex_end1 { int m; struct flex1 flex_data; }; >> regardless of whether considered

Re: [V2][PATCH] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-02-08 Thread Qing Zhao via Gcc-patches
I found a bug with this patch, will fix it and send out the updated patch. Please ignore this one. sorry. Qing > On Feb 6, 2023, at 8:47 AM, Qing Zhao wrote: > > This is the 2nd version of the patch, compare to the first version, the major > changes are: > > 1

Re: [PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-02-08 Thread Qing Zhao via Gcc-patches
> On Feb 7, 2023, at 6:37 PM, Joseph Myers wrote: > > On Tue, 7 Feb 2023, Qing Zhao via Gcc-patches wrote: > >> Then, this routine (flexible_array_type_p) is mainly for diagnostic purpose. >> It cannot be used to determine whether the structure/union type recursive

Re: [PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-02-07 Thread Qing Zhao via Gcc-patches
> On Feb 7, 2023, at 2:17 PM, Joseph Myers wrote: > > On Tue, 7 Feb 2023, Qing Zhao via Gcc-patches wrote: > >> 1. Structure with flexible array member embedded into other structures >> recursively, for example: >> >> struct A { >> int n; >>

Re: [PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-02-07 Thread Qing Zhao via Gcc-patches
> On Feb 7, 2023, at 10:28 AM, Siddhesh Poyarekar wrote: > > On 2023-02-06 18:14, Joseph Myers wrote: >> On Mon, 6 Feb 2023, Qing Zhao via Gcc-patches wrote: >>> In GCC14: >>> >>> 1. Include this new warning -Wgnu-varaible-sized-type-not-at-end to

Re: [PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-02-07 Thread Qing Zhao via Gcc-patches
Hi, Joseph, > On Feb 6, 2023, at 6:14 PM, Joseph Myers wrote: > > On Mon, 6 Feb 2023, Qing Zhao via Gcc-patches wrote: > >> In GCC14: >> >> 1. Include this new warning -Wgnu-varaible-sized-type-not-at-end to -Wall >> 2. Deprecate this extension from

Re: [PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-02-06 Thread Qing Zhao via Gcc-patches
> On Feb 6, 2023, at 4:31 AM, Richard Biener wrote: > > On Fri, 3 Feb 2023, Qing Zhao wrote: > >> >> >>> On Feb 3, 2023, at 2:49 AM, Richard Biener wrote: >>> >>> On Thu, 2 Feb 2023, Qing Zhao wrote: >>> >>

[V2][PATCH] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-02-06 Thread Qing Zhao via Gcc-patches
This is the 2nd version of the patch, compare to the first version, the major changes are: 1. Add a new IR bit in tree_type_common: type_include_flexarray, set this bit in FE for struct/union types that include a flexible array member (per -fstrict-flex-arrays) at the end. 2. Check

Re: [PATCH 2/2] Documentation Update.

2023-02-03 Thread Qing Zhao via Gcc-patches
Okay, thanks all for the comments and suggestions. Based on the discussion so far, I have the following plan for resolving this issue: In GCC13: 1. Add documentation in extend.texi to include all the following 3 cases as GCC extension: Case 1: The structure with a flexible array member is

Re: [PATCH 2/2] Documentation Update.

2023-02-03 Thread Qing Zhao via Gcc-patches
> On Feb 2, 2023, at 11:25 PM, Siddhesh Poyarekar wrote: > > On 2023-02-02 03:33, Richard Biener wrote: >> looking at PR77650 what seems missing there is the semantics of this >> extension as expected/required by the glibc use. comment#5 seems >> to suggest that for my example above its

Re: [PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-02-03 Thread Qing Zhao via Gcc-patches
> On Feb 3, 2023, at 2:49 AM, Richard Biener wrote: > > On Thu, 2 Feb 2023, Qing Zhao wrote: > >> >> >>> On Feb 2, 2023, at 8:54 AM, Richard Biener wrote: >>> >>> On Thu, 2 Feb 2023, Qing Zhao wrote: >>> >>>> &g

Re: [PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-02-02 Thread Qing Zhao via Gcc-patches
> On Feb 2, 2023, at 8:54 AM, Richard Biener wrote: > > On Thu, 2 Feb 2023, Qing Zhao wrote: > >> >> >>> On Feb 2, 2023, at 3:07 AM, Richard Biener wrote: >>> >>> On Wed, 1 Feb 2023, Qing Zhao wrote: >>> >>

Re: [PATCH 2/2] Documentation Update.

2023-02-02 Thread Qing Zhao via Gcc-patches
> On Feb 2, 2023, at 3:33 AM, Richard Biener wrote: > > On Wed, 1 Feb 2023, Siddhesh Poyarekar wrote: > >> On 2023-02-01 13:24, Qing Zhao wrote: >>> >>> >>>> On Feb 1, 2023, at 11:55 AM, Siddhesh Poyarekar >>>> wrote: &

Re: [PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-02-02 Thread Qing Zhao via Gcc-patches
> On Feb 2, 2023, at 3:07 AM, Richard Biener wrote: > > On Wed, 1 Feb 2023, Qing Zhao wrote: > >> >> >>> On Feb 1, 2023, at 6:41 AM, Richard Biener wrote: >>> >>> On Tue, 31 Jan 2023, Qing Zhao wrote: >>> >>>> G

Re: [PATCH 2/2] Documentation Update.

2023-02-01 Thread Qing Zhao via Gcc-patches
> On Feb 1, 2023, at 1:57 PM, Siddhesh Poyarekar wrote: > > On 2023-02-01 13:24, Qing Zhao wrote: >>> On Feb 1, 2023, at 11:55 AM, Siddhesh Poyarekar wrote: >>> >>> On 2023-01-31 09:11, Qing Zhao wrote: >>>> Update documentation to clarify

Re: [PATCH 2/2] Documentation Update.

2023-02-01 Thread Qing Zhao via Gcc-patches
> On Feb 1, 2023, at 11:55 AM, Siddhesh Poyarekar wrote: > > On 2023-01-31 09:11, Qing Zhao wrote: >> Update documentation to clarify a GCC extension on structure with >> flexible array member being nested in another structure. >> gcc/ChangeLog: >>

Re: [PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-02-01 Thread Qing Zhao via Gcc-patches
Siddhesh, Thanks. I will update the testing case per your change. Qing > On Feb 1, 2023, at 11:48 AM, Siddhesh Poyarekar wrote: > > On 2023-01-31 09:11, Qing Zhao wrote: >> GCC extension accepts the case when a struct with a flexible array member >> is embedded into ano

Re: [PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-02-01 Thread Qing Zhao via Gcc-patches
> On Feb 1, 2023, at 6:41 AM, Richard Biener wrote: > > On Tue, 31 Jan 2023, Qing Zhao wrote: > >> GCC extension accepts the case when a struct with a flexible array member >> is embedded into another struct (possibly recursively). >> __builtin_object_size should

[PATCH 2/2] Documentation Update.

2023-01-31 Thread Qing Zhao via Gcc-patches
Update documentation to clarify a GCC extension on structure with flexible array member being nested in another structure. gcc/ChangeLog: * doc/extend.texi: Document GCC extension on a structure containing a flexible array member to be a member of another structure. ---

[PATCH 0/2]PR101832: Handle component_ref to a structure/union field including flexible array member for builtin_object_size

2023-01-31 Thread Qing Zhao via Gcc-patches
This is the patch for PR101832, to fix builtin_object_size to correctly handle component_ref to a structure/union field that includes a flexible array member. also includes a documentation update for the GCC extension on embedding a structure/union with flexible array member into another

[PATCH 1/2] Handle component_ref to a structre/union field including flexible array member [PR101832]

2023-01-31 Thread Qing Zhao via Gcc-patches
GCC extension accepts the case when a struct with a flexible array member is embedded into another struct (possibly recursively). __builtin_object_size should treat such struct as flexible size per -fstrict-flex-arrays. PR tree-optimization/101832 gcc/ChangeLog: PR

Re: [PATCH 2/2] tree-object-size: More consistent behaviour with flex arrays

2023-01-26 Thread Qing Zhao via Gcc-patches
> On Jan 26, 2023, at 12:16 PM, Siddhesh Poyarekar wrote: > > On 2023-01-26 11:20, Qing Zhao wrote: >> Hi, Siddhesh, >> Thanks a lot for this patch, after -fstrict-flex-array functionality has >> been added into GCC, >> I think that making the tree-object

Re: [PATCH 2/2] tree-object-size: More consistent behaviour with flex arrays

2023-01-26 Thread Qing Zhao via Gcc-patches
Hi, Siddhesh, Thanks a lot for this patch, after -fstrict-flex-array functionality has been added into GCC, I think that making the tree-object-size to have consistent behavior with flex arrays is a valuable and natural work that need to be added. I also like the comments you added into

Re: gcc-13/changes.html: Mention -fstrict-flex-arrays and its impact

2023-01-17 Thread Qing Zhao via Gcc-patches
Thanks for the comment. I just committed the following: >From fc681f5412c421ff9609aea448310106d2570fd5 Mon Sep 17 00:00:00 2001 From: Qing Zhao Date: Tue, 17 Jan 2023 15:52:15 + Subject: [PATCH] gcc13/changes: update id 'flexible array' to 'flexible-arrays' since ids must not cont

[PATCH 1/1] Replace flag_strict_flex_arrays with DECL_NOT_FLEXARRAY in middle-end

2023-01-12 Thread Qing Zhao via Gcc-patches
We should not directly check flag_strict_flex_arrays in the middle end. Instead, check DECL_NOT_FLEXARRAY(array_field_decl) which is set by C/C++ FEs according to -fstrict-flex-arrays and the corresponding attribute attached to the array_field. As a result, We will lose the LEVEL information of

[PATCH 0/1] Replace flag_strict_flex_arrays with DECL_NOT_FLEXARRAY in middle-end

2023-01-12 Thread Qing Zhao via Gcc-patches
this is the patch to replace all references to flag_strict_flex_arrays with DECL_NOT_FLEXARRAY in middle-end per the discussion. I have bootstrapped and regression tested on X86, no issues. Okay for commit? thanks. Qing

Re: gcc-13/changes.html: Mention -fstrict-flex-arrays and its impact

2023-01-10 Thread Qing Zhao via Gcc-patches
> On Jan 10, 2023, at 3:06 AM, Richard Biener wrote: > > On Mon, 9 Jan 2023, Qing Zhao wrote: > >> >> >>> On Jan 9, 2023, at 2:11 AM, Richard Biener wrote: >>> >>> On Thu, 22 Dec 2022, Qing Zhao wrote: >>> >>

Re: gcc-13/changes.html: Mention -fstrict-flex-arrays and its impact

2023-01-09 Thread Qing Zhao via Gcc-patches
> On Jan 9, 2023, at 2:11 AM, Richard Biener wrote: > > On Thu, 22 Dec 2022, Qing Zhao wrote: > >> >> >>> On Dec 22, 2022, at 2:09 AM, Richard Biener wrote: >>> >>> On Wed, 21 Dec 2022, Qing Zhao wrote: >>> >>>> Hi

Re: [PATCH V2] Disable sched1 in functions that call setjmp

2023-01-05 Thread Qing Zhao via Gcc-patches
Alexander, (Sorry for the late reply due to holiday vacation). > On Dec 24, 2022, at 3:10 AM, Alexander Monakov wrote: > > > On Fri, 23 Dec 2022, Qing Zhao wrote: > >> BTW, Why sched1 is not enabled on x86 by default? > > Register allocation is tricky on x86 due

Re: [PATCH V2] Disable sched1 in functions that call setjmp

2022-12-23 Thread Qing Zhao via Gcc-patches
> On Dec 23, 2022, at 2:36 PM, Alexander Monakov wrote: > > > > On Fri, 23 Dec 2022, Qing Zhao wrote: > >> Then, sched2 still can move insn across calls? >> So does sched2 have the same issue of incorrectly moving the insn across a >> call which ha

Re: [PATCH V2] Disable sched1 in functions that call setjmp

2022-12-23 Thread Qing Zhao via Gcc-patches
Then, sched2 still can move insn across calls? So does sched2 have the same issue of incorrectly moving the insn across a call which has unknown control flow? Qing > On Dec 23, 2022, at 12:31 PM, Alexander Monakov wrote: > > > On Fri, 23 Dec 2022, Jose E. Marchesi wrote: > >>> (scheduling

Re: [PATCH V2] Disable sched1 in functions that call setjmp

2022-12-23 Thread Qing Zhao via Gcc-patches
> On Dec 23, 2022, at 2:33 AM, Alexander Monakov wrote: > > > On Thu, 22 Dec 2022, Qing Zhao wrote: > >>> I think scheduling across calls in the pre-RA scheduler is simply an >>> oversight, >>> we do not look at dataflow information and w

Re: [PATCH V2] Disable sched1 in functions that call setjmp

2022-12-22 Thread Qing Zhao via Gcc-patches
> On Dec 22, 2022, at 12:56 PM, Alexander Monakov wrote: > > > On Thu, 22 Dec 2022, Jose E. Marchesi via Gcc-patches wrote: > >> The first instruction scheduler pass reorders instructions in the TRY >> block in a way `b=true' gets executed before the call to the function >> `f'. This

Re: gcc-13/changes.html: Mention -fstrict-flex-arrays and its impact

2022-12-22 Thread Qing Zhao via Gcc-patches
> On Dec 22, 2022, at 2:09 AM, Richard Biener wrote: > > On Wed, 21 Dec 2022, Qing Zhao wrote: > >> Hi, Richard, >> >> Thanks a lot for your comments. >> >>> On Dec 21, 2022, at 2:12 AM, Richard Biener wrote: >>>

Re: gcc-13/changes.html: Mention -fstrict-flex-arrays and its impact

2022-12-21 Thread Qing Zhao via Gcc-patches
Hi, Richard, Thanks a lot for your comments. > On Dec 21, 2022, at 2:12 AM, Richard Biener wrote: > > On Tue, 20 Dec 2022, Qing Zhao wrote: > >> Hi, >> >> This is the patch for mentioning -fstrict-flex-arrays and -Warray-bounds=2 >> changes in gcc-13/cha

gcc-13/changes.html: Mention -fstrict-flex-arrays and its impact

2022-12-20 Thread Qing Zhao via Gcc-patches
001 From: Qing Zhao Date: Tue, 20 Dec 2022 16:13:04 + Subject: [PATCH] gcc-13/changes: Mention -fstrict-flex-arrays and its impact. --- htdocs/gcc-13/changes.html | 15 +++ 1 file changed, 15 insertions(+) diff --git a/htdocs/gcc-13/changes.html b/htdocs/gcc-13/changes.html in

Re: Ping---[V3][PATCH 2/2] Add a new warning option -Wstrict-flex-arrays.

2022-12-16 Thread Qing Zhao via Gcc-patches
FYI. Committed this last patch as: https://jira.oci.oraclecorp.com/browse/OLDIS-21095 I will come up with the update to gcc-13/changes.html for -fstrict-flex-arrays very soon. Thanks. Qing > On Dec 16, 2022, at 9:49 AM, Qing Zhao via Gcc-patches > wrote: > > > >> On

Re: Ping---[V3][PATCH 2/2] Add a new warning option -Wstrict-flex-arrays.

2022-12-16 Thread Qing Zhao via Gcc-patches
> On Dec 16, 2022, at 4:17 AM, Richard Biener wrote: > > On Thu, 15 Dec 2022, Qing Zhao wrote: > >> >> >>> On Dec 15, 2022, at 2:47 AM, Richard Biener wrote: >>> >>> On Wed, 14 Dec 2022, Qing Zhao wrote: >>> >>>

Re: Ping---[V3][PATCH 2/2] Add a new warning option -Wstrict-flex-arrays.

2022-12-15 Thread Qing Zhao via Gcc-patches
> On Dec 15, 2022, at 2:47 AM, Richard Biener wrote: > > On Wed, 14 Dec 2022, Qing Zhao wrote: > >> Hi, Richard, >> >> I guess that we now agreed on the following: >> >> “ the information that we ran into a trailing array but didn't consider &

Re: Ping---[V3][PATCH 2/2] Add a new warning option -Wstrict-flex-arrays.

2022-12-14 Thread Qing Zhao via Gcc-patches
pinion. thanks. Qing > On Dec 14, 2022, at 4:03 AM, Richard Biener wrote: > > On Tue, 13 Dec 2022, Qing Zhao wrote: > >> Richard, >> >> Do you have any decision on this one? >> Do we need this warning option For GCC? > > Looking at the testcases it s

Re: Ping---[V3][PATCH 2/2] Add a new warning option -Wstrict-flex-arrays.

2022-12-14 Thread Qing Zhao via Gcc-patches
> On Dec 14, 2022, at 9:08 AM, Qing Zhao via Gcc-patches > wrote: > > > >> On Dec 14, 2022, at 4:03 AM, Richard Biener wrote: >> >> On Tue, 13 Dec 2022, Qing Zhao wrote: >> >>> Richard, >>> >>> Do you have any

Re: Ping---[V3][PATCH 2/2] Add a new warning option -Wstrict-flex-arrays.

2022-12-14 Thread Qing Zhao via Gcc-patches
> On Dec 14, 2022, at 4:03 AM, Richard Biener wrote: > > On Tue, 13 Dec 2022, Qing Zhao wrote: > >> Richard, >> >> Do you have any decision on this one? >> Do we need this warning option For GCC? > > Looking at the testcases it seems t

Ping---[V3][PATCH 2/2] Add a new warning option -Wstrict-flex-arrays.

2022-12-13 Thread Qing Zhao via Gcc-patches
Richard, Do you have any decision on this one? Do we need this warning option For GCC? thanks. Qing > On Dec 6, 2022, at 11:18 AM, Qing Zhao wrote: > > '-Wstrict-flex-arrays' > Warn about inproper usages of flexible array members according to > the LEVEL of the 'st

[V3][PATCH 2/2] Add a new warning option -Wstrict-flex-arrays.

2022-12-06 Thread Qing Zhao via Gcc-patches
'-Wstrict-flex-arrays' Warn about inproper usages of flexible array members according to the LEVEL of the 'strict_flex_array (LEVEL)' attribute attached to the trailing array field of a structure if it's available, otherwise according to the LEVEL of the option

Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-06 Thread Qing Zhao via Gcc-patches
Sorry, Please ignore this email. Qing > On Dec 6, 2022, at 11:14 AM, Qing Zhao wrote: > > '-Wstrict-flex-arrays' > Warn about inproper usages of flexible array members according to > the LEVEL of the 'strict_flex_array (LEVEL)' attribute attached to > the tr

[V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-06 Thread Qing Zhao via Gcc-patches
'-Wstrict-flex-arrays' Warn about inproper usages of flexible array members according to the LEVEL of the 'strict_flex_array (LEVEL)' attribute attached to the trailing array field of a structure if it's available, otherwise according to the LEVEL of the option

[V3][PATCH 1/2] Update -Warray-bounds with -fstrict-flex-arrays.

2022-12-06 Thread Qing Zhao via Gcc-patches
A. add the following to clarify the relationship between -Warray-bounds and the LEVEL of -fstrict-flex-array: By default, the trailing array of a structure will be treated as a flexible array member by '-Warray-bounds' or '-Warray-bounds=N' if it is declared as either

[V3][PATCH 0/2]Update -Warray-bounds with -fstrict-flex-arrays

2022-12-06 Thread Qing Zhao via Gcc-patches
Hi, this is the 3rd version of the patch. Per Richard's request, I split the patch into two seperate patches: 1. Update -Warray-bounds with -fstrict-flex-arrays. 2. Add a new warning option -Wstrict-flex-arrays. I have bootstrapped and regression tested on both X86 and aarch64 without any

Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-05 Thread Qing Zhao via Gcc-patches
> On Dec 5, 2022, at 10:16 AM, Richard Biener wrote: > > On Fri, 2 Dec 2022, Qing Zhao wrote: > >> >> >>> On Dec 2, 2022, at 2:20 AM, Richard Biener wrote: >>> >>> On Fri, 2 Dec 2022, Richard Biener wrote: >>> >>>>

Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-02 Thread Qing Zhao via Gcc-patches
> On Dec 2, 2022, at 2:20 AM, Richard Biener wrote: > > On Fri, 2 Dec 2022, Richard Biener wrote: > >> On Thu, 1 Dec 2022, Siddhesh Poyarekar wrote: >> >>> On 2022-12-01 11:42, Kees Cook wrote: >>>> On Wed, Nov 30, 2022 at 02:25:56PM +,

Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-02 Thread Qing Zhao via Gcc-patches
> On Dec 2, 2022, at 2:16 AM, Richard Biener wrote: > > On Thu, 1 Dec 2022, Siddhesh Poyarekar wrote: > >> On 2022-12-01 11:42, Kees Cook wrote: >>> On Wed, Nov 30, 2022 at 02:25:56PM +, Qing Zhao wrote: >>>> '-Wstrict-flex-arrays' >>>>

Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-01 Thread Qing Zhao via Gcc-patches
esh Poyarekar wrote: > > On 2022-12-01 11:42, Kees Cook wrote: >> On Wed, Nov 30, 2022 at 02:25:56PM +, Qing Zhao wrote: >>> '-Wstrict-flex-arrays' >>> Warn about inproper usages of flexible array members according to >>> the LEVEL o

Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-01 Thread Qing Zhao via Gcc-patches
ote: > > On Thu, Dec 01, 2022 at 05:04:02PM +0000, Qing Zhao wrote: >> >> >>> On Dec 1, 2022, at 11:42 AM, Kees Cook wrote: >>> >>> On Wed, Nov 30, 2022 at 02:25:56PM +, Qing Zhao wrote: >>>> '-Wstrict-flex-arrays' >>&g

Re: [V2][PATCH 1/1] Add a new warning option -Wstrict-flex-arrays.

2022-12-01 Thread Qing Zhao via Gcc-patches
> On Dec 1, 2022, at 11:42 AM, Kees Cook wrote: > > On Wed, Nov 30, 2022 at 02:25:56PM +0000, Qing Zhao wrote: >> '-Wstrict-flex-arrays' >> Warn about inproper usages of flexible array members according to >> the LEVEL of the 'strict_flex_array

<    1   2   3   4   5   6   7   8   9   10   >