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
our opinion. 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

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 consid

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

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: 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

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: >>> >>> On Tue,

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 optimi

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 with 5

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: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

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: 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: 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: >>> >>

[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 -f

[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-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' sin

Re: Another bug for __builtin_object_size? (Or expected behavior)

2023-08-23 Thread Qing Zhao via Gcc-patches
> On Aug 18, 2023, at 12:00 PM, Qing Zhao via Gcc-patches > wrote: > > > >> On Aug 17, 2023, at 5:32 PM, Siddhesh Poyarekar wrote: >> >> On 2023-08-17 17:25, Qing Zhao wrote: >>>> It's not exactly the same issue, the earlier discussion was

[V3][PATCH 1/3] Provide counted_by attribute to flexible array member field (PR108896)

2023-08-25 Thread Qing Zhao via Gcc-patches
Provide a new counted_by attribute to flexible array member field. 'counted_by (COUNT)' The 'counted_by' attribute may be attached to the flexible array member of a structure. It indicates that the number of the elements of the array is given by the field named "COUNT" in the

[V3][PATCH 0/3] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2023-08-25 Thread Qing Zhao via Gcc-patches
k on: https://gcc.gnu.org/pipermail/gcc-patches/2023-May/619708.html and more discussions on https://gcc.gnu.org/pipermail/gcc-patches/2023-August/626376.html Okay for committing? thanks. Qing Qing Zhao (3): Provide counted_by attribute to flexible array member field (PR108896) Use the counted_by

[V3][PATCH 2/3] Use the counted_by atribute info in builtin object size [PR108896]

2023-08-25 Thread Qing Zhao via Gcc-patches
Use the counted_by atribute info in builtin object size to compute the subobject size for flexible array members. gcc/ChangeLog: PR C/108896 * tree-object-size.cc (addr_object_size): Use the counted_by attribute info. * tree.cc (component_ref_has_counted_by_p): New

[V3][PATCH 3/3] Use the counted_by attribute information in bound sanitizer[PR108896]

2023-08-25 Thread Qing Zhao via Gcc-patches
Use the counted_by attribute information in bound sanitizer. gcc/c-family/ChangeLog: PR C/108896 * c-ubsan.cc (ubsan_instrument_bounds): Use counted_by attribute information. gcc/testsuite/ChangeLog: PR C/108896 * gcc.dg/ubsan/flex-array-counted-by-bounds

Re: RFC: Introduce -fhardened to enable security-related flags

2023-09-01 Thread Qing Zhao via Gcc-patches
> On Aug 29, 2023, at 3:42 PM, Marek Polacek via Gcc-patches > wrote: > > Improving the security of software has been a major trend in the recent > years. Fortunately, GCC offers a wide variety of flags that enable extra > hardening. These flags aren't enabled by default, though. And since

Re: [V3][PATCH 0/3] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2023-09-08 Thread Qing Zhao via Gcc-patches
Ping. Thanks. Qing > On Aug 25, 2023, at 11:24 AM, Qing Zhao wrote: > > This is the 3rd version of the patch, per our discussion based on the > review comments for the 1st and 2nd version, the major changes in this > version are: > > ***Against 1st version:

Re: [V3][PATCH 1/3] Provide counted_by attribute to flexible array member field (PR108896)

2023-09-08 Thread Qing Zhao via Gcc-patches
PIng. thanks. Qing > On Aug 25, 2023, at 11:24 AM, Qing Zhao wrote: > > Provide a new counted_by attribute to flexible array member field. > > 'counted_by (COUNT)' > The 'counted_by' attribute may be attached to the flexible array > memb

Re: [V3][PATCH 3/3] Use the counted_by attribute information in bound sanitizer[PR108896]

2023-09-08 Thread Qing Zhao via Gcc-patches
Ping. thanks. Qing > On Aug 25, 2023, at 11:24 AM, Qing Zhao wrote: > > Use the counted_by attribute information in bound sanitizer. > > gcc/c-family/ChangeLog: > > PR C/108896 > * c-ubsan.cc (ubsan_instrument_bounds): Use counted_by attribute >

Re: [V3][PATCH 2/3] Use the counted_by atribute info in builtin object size [PR108896]

2023-09-08 Thread Qing Zhao via Gcc-patches
Ping. thanks. Qing > On Aug 25, 2023, at 11:24 AM, Qing Zhao wrote: > > Use the counted_by atribute info in builtin object size to compute the > subobject size for flexible array members. > > gcc/ChangeLog: > > PR C/108896 > * tree-object-size.cc

[PATCH] tree optimization/111407--SSA corruption due to widening_mul opt

2023-09-14 Thread Qing Zhao via Gcc-patches
on conflict across an abnormal edge This is a bug in tree-ssa-math-opts.cc, when applying the widening mul optimization, the compiler needs to check whether the operand is in a ABNORMAL PHI, if YES, we should avoid the transformation. bootstrapped and regression tested on both aarch64 and x86, no

Question on -fwrapv and -fwrapv-pointer

2023-09-14 Thread Qing Zhao via Gcc-patches
Hi, I have several questions on these options: 1.are pointers treated as signed integers in general? (I thought that pointers are addresses to the memory, should be treated as unsigned integer…) 2. If Yes, why? 3. why a separate option for pointesr -fwrapv-pointer in addition to -fwrapv if the

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-14 Thread Qing Zhao via Gcc-patches
Thanks for the info. > On Sep 14, 2023, at 10:06 AM, Richard Biener > wrote: > > On Thu, Sep 14, 2023 at 3:42 PM Qing Zhao via Gcc-patches > wrote: >> >> Hi, >> >> I have several questions on these options: >> >> 1.are pointers tre

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-14 Thread Qing Zhao via Gcc-patches
> On Sep 14, 2023, at 11:12 AM, Richard Biener > wrote: > > > >> Am 14.09.2023 um 17:01 schrieb Qing Zhao : >> >> Thanks for the info. >> >>> On Sep 14, 2023, at 10:06 AM, Richard Biener >>> wrote: >>> >>

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-14 Thread Qing Zhao via Gcc-patches
> On Sep 14, 2023, at 12:18 PM, Xi Ruoyao wrote: > > On Thu, 2023-09-14 at 15:57 +0000, Qing Zhao via Gcc-patches wrote: >> Currently, GCC behaves as following: >> >> /* True if overflow wraps around for the given integral or pointer type. >> That &

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-14 Thread Qing Zhao via Gcc-patches
> On Sep 14, 2023, at 4:57 PM, Andrew Pinski wrote: > > On Thu, Sep 14, 2023 at 1:50 PM Qing Zhao via Gcc-patches > wrote: >> >> >> >>> On Sep 14, 2023, at 12:18 PM, Xi Ruoyao wrote: >>> >>> On Thu, 2023-09-14 at 15:57 +, Qin

Re: [PATCH] tree optimization/111407--SSA corruption due to widening_mul opt

2023-09-15 Thread Qing Zhao via Gcc-patches
thanks. Committed as https://gcc.gnu.org/pipermail/gcc-cvs/2023-September/389614.html Qing > On Sep 15, 2023, at 2:12 AM, Richard Biener > wrote: > > On Thu, Sep 14, 2023 at 3:25 PM Qing Zhao via Gcc-patches > wrote: >> >> on conflict across an abnormal edge >&

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-15 Thread Qing Zhao via Gcc-patches
> On Sep 15, 2023, at 3:43 AM, Xi Ruoyao wrote: > > On Thu, 2023-09-14 at 21:41 +0000, Qing Zhao wrote: >>>> CLANG already provided -fsanitize=unsigned-integer-overflow. GCC >>>> might need to do the same. >>> >>> NO. There is no such thi

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-15 Thread Qing Zhao via Gcc-patches
> On Sep 15, 2023, at 8:41 AM, Arsen Arsenović wrote: > > > Qing Zhao writes: > >> Even though unsigned integer overflow is well defined, it might be >> unintentional, shall we warn user about this? > > This would be better addressed by providing operator

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-15 Thread Qing Zhao via Gcc-patches
> On Sep 15, 2023, at 11:29 AM, Richard Biener > wrote: > > > >> Am 15.09.2023 um 17:25 schrieb Qing Zhao : >> >>  >> >>> On Sep 15, 2023, at 8:41 AM, Arsen Arsenović wrote: >>> >>> >>> Qing Zhao writes: &

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-15 Thread Qing Zhao via Gcc-patches
> On Sep 15, 2023, at 1:26 PM, Richard Biener > wrote: > > > >> Am 15.09.2023 um 17:37 schrieb Qing Zhao : >> >>  >> >>>> On Sep 15, 2023, at 11:29 AM, Richard Biener >>>> wrote: >>>> >>>> >>

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-15 Thread Qing Zhao via Gcc-patches
> On Sep 15, 2023, at 12:53 PM, Xi Ruoyao wrote: > > On Fri, 2023-09-15 at 15:37 +0000, Qing Zhao wrote: >> >> >>> On Sep 15, 2023, at 11:29 AM, Richard Biener >>> wrote: >>> >>> >>> >>>> Am 15.09.2023 um

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-10 Thread Qing Zhao via Gcc-patches
Hi, > On Aug 7, 2020, at 5:59 PM, Segher Boessenkool > wrote: > >> From my understanding (I am not a security expert though), this patch should >> serve two purpose: >> >> 1. Erase the registers upon return to avoid information leak; > > But only some of the registers. All the call-used re

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-10 Thread Qing Zhao via Gcc-patches
>> >>> If so, I am okay with name “call-clobbered” if this name sounds better. >> >> It's more obvious, at least to me. In the current option list of GCC: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-11 Thread Qing Zhao via Gcc-patches
Hi, Alexandre, CC’ing Richard for his comments on this. > On Aug 10, 2020, at 9:39 PM, Alexandre Oliva wrote: >> I think that moving how to zeroing the registers part to each target >> will be a better solution since each target has >> Better idea on how to use the most efficient insns to do th

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-19 Thread Qing Zhao via Gcc-patches
else in this patch sanely. > > > Segher zeroing call-used registers for security purpose 8/19/2020 Qing Zhao = **Motivation: There are two purposes of this patch: 1. ROP mitigation: ROP (Return-oriented programming, https://en.wikipedia.org/wiki/Retu

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-19 Thread Qing Zhao via Gcc-patches
> On Aug 19, 2020, at 5:57 PM, Segher Boessenkool > wrote: > > Hi! > > On Wed, Aug 19, 2020 at 03:05:36PM -0500, Qing Zhao wrote: >> So, cleaning the scratch registers that are used to pass parameters at >> return instructions should >> effectively mi

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-24 Thread Qing Zhao via Gcc-patches
> On Aug 24, 2020, at 5:50 AM, Richard Biener wrote: > > On Tue, 11 Aug 2020, Qing Zhao wrote: > >> Hi, Alexandre, >> >> CC’ing Richard for his comments on this. >> >> >>> On Aug 10, 2020, at 9:39 PM, Alexandre Oliva wrote: >>&g

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-24 Thread Qing Zhao via Gcc-patches
> On Aug 24, 2020, at 12:49 PM, Segher Boessenkool > wrote: > > On Wed, Aug 19, 2020 at 06:27:45PM -0500, Qing Zhao wrote: >>> On Aug 19, 2020, at 5:57 PM, Segher Boessenkool >>> wrote: >>> Numbers on how expensive this is (for what arch, in code s

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-24 Thread Qing Zhao via Gcc-patches
> On Aug 24, 2020, at 12:59 PM, Segher Boessenkool > wrote: > > [ Please quote correctly. I fixed this up a bit. ] > > On Mon, Aug 24, 2020 at 02:47:22PM +, Rodriguez Bahena, Victor wrote: >>> The call-clobbered regs are the only ones you *can* touch. That does >>> not mean you should

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-24 Thread Qing Zhao via Gcc-patches
> On Aug 24, 2020, at 3:20 PM, Segher Boessenkool > wrote: > > Hi! > > On Mon, Aug 24, 2020 at 01:02:03PM -0500, Qing Zhao wrote: >>> On Aug 24, 2020, at 12:49 PM, Segher Boessenkool >>> wrote: >>> On Wed, Aug 19, 2020 at 06:27:45PM -0500, Qi

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-24 Thread Qing Zhao via Gcc-patches
> On Aug 24, 2020, at 3:26 PM, Segher Boessenkool > wrote: > > On Mon, Aug 24, 2020 at 01:48:02PM -0500, Qing Zhao wrote: >> >> >>> On Aug 24, 2020, at 12:59 PM, Segher Boessenkool >>> wrote: >>> >>> [ Please quote correctly.

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-25 Thread Qing Zhao via Gcc-patches
> On Aug 25, 2020, at 1:41 AM, Uros Bizjak wrote: > >>> > (The other side of the coin is how much this helps prevent exploitation; > numbers on that would be good to see, too.) This can be well showed from the paper: "Clean the Scratch Registers: A Way to Mitigat

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-25 Thread Qing Zhao via Gcc-patches
> On Aug 24, 2020, at 3:20 PM, Segher Boessenkool > wrote: > > Hi! > > On Mon, Aug 24, 2020 at 01:02:03PM -0500, Qing Zhao wrote: >>> On Aug 24, 2020, at 12:49 PM, Segher Boessenkool >>> wrote: >>> On Wed, Aug 19, 2020 at 06:27:45PM -0500, Qi

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-25 Thread Qing Zhao via Gcc-patches
> On Aug 25, 2020, at 9:05 AM, Qing Zhao via Gcc-patches > wrote: > > > >> On Aug 25, 2020, at 1:41 AM, Uros Bizjak wrote: >> >>>> >>>>>> (The other side of the coin is how much this helps prevent exploitation; >>>>&g

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-26 Thread Qing Zhao via Gcc-patches
> On Aug 26, 2020, at 7:02 AM, Alexandre Oliva wrote: > > On Aug 25, 2020, Jeff Law mailto:l...@redhat.com>> wrote: > >> On Tue, 2020-08-25 at 02:16 -0300, Alexandre Oliva wrote: >>> On Aug 24, 2020, Richard Biener wrote: >>> since the option is quite elaborate on what (sub-)set of reg

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-28 Thread Qing Zhao via Gcc-patches
> On Aug 28, 2020, at 2:47 AM, Alexandre Oliva wrote: > > On Aug 26, 2020, Qing Zhao wrote: > >> There are two issues I can see with adding a default generator in middle end: > >> 1. In order to determine where a target should not use the generic >> code t

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-03 Thread Qing Zhao via Gcc-patches
, at 4:54 PM, Qing Zhao via Gcc-patches > wrote: > > > >> On Aug 24, 2020, at 3:20 PM, Segher Boessenkool >> wrote: >> >> Hi! >> >> On Mon, Aug 24, 2020 at 01:02:03PM -0500, Qing Zhao wrote: >>>> On Aug 24, 2020, at 12:49 PM, Segher

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-03 Thread Qing Zhao via Gcc-patches
p 3, 2020, at 9:29 AM, Qing Zhao via Gcc-patches > wrote: > > Hi, > > Per request, I collected runtime performance data and code size data with > CPU2017 on a X86 platform. > > *** Machine info: > model name>-: Intel(R) Xeon(R) CPU E5-2699 v4 @ 2.20GHz &g

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-03 Thread Qing Zhao via Gcc-patches
> On Sep 3, 2020, at 10:08 AM, Qing Zhao via Gcc-patches > wrote: > > > Hi, > > Looks like both attached .csv files were deleted during the email delivery > procedure. Not sure what’s the reason for this. > > Then I have to copy the text file here for you refer

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-03 Thread Qing Zhao via Gcc-patches
> On Sep 3, 2020, at 12:13 PM, Kees Cook wrote: > > On Thu, Sep 03, 2020 at 09:29:54AM -0500, Qing Zhao wrote: >> On average, all the options starting with “used_…” (i.e, only the registers >> that are used in the routine will be zeroed) have very low runtime >&

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-03 Thread Qing Zhao via Gcc-patches
> On Sep 3, 2020, at 12:48 PM, Ramana Radhakrishnan > wrote: > > On Thu, Sep 3, 2020 at 6:13 PM Kees Cook via Gcc-patches > wrote: >> >> On Thu, Sep 03, 2020 at 09:29:54AM -0500, Qing Zhao wrote: >>> On average, all the options starting with “used_…” (i

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-04 Thread Qing Zhao via Gcc-patches
> On Sep 3, 2020, at 8:23 PM, Rodriguez Bahena, Victor > wrote: > > > > -Original Message- > From: Qing Zhao mailto:qing.z...@oracle.com>> > Date: Thursday, September 3, 2020 at 12:55 PM > To: Kees Cook mailto:keesc...@chromium.org>>

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-04 Thread Qing Zhao via Gcc-patches
> On Sep 4, 2020, at 10:43 AM, Segher Boessenkool > wrote: > > On Thu, Sep 03, 2020 at 10:13:35AM -0700, Kees Cook wrote: >> On Thu, Sep 03, 2020 at 09:29:54AM -0500, Qing Zhao wrote: >>> On average, all the options starting with “used_…” (i.e, only the >>

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-04 Thread Qing Zhao via Gcc-patches
> On Sep 4, 2020, at 1:04 PM, Segher Boessenkool > wrote: > > On Fri, Sep 04, 2020 at 12:18:12PM -0500, Qing Zhao wrote: >>> I call this very expensive, already, >> >> Yes, I think that 17.56% on average is quite expensive. That’s the data for >> -f

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-08 Thread Qing Zhao via Gcc-patches
> On Sep 7, 2020, at 9:36 AM, Segher Boessenkool > wrote: > > On Fri, Sep 04, 2020 at 02:00:41PM -0500, Qing Zhao wrote: >>>> However, if we only clear USED registers, the worst case is 1.72% on >>>> average. This overhead is very reasonable. >>

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-08 Thread Qing Zhao via Gcc-patches
> On Sep 7, 2020, at 8:06 AM, Rodriguez Bahena, Victor > wrote: > > > > From: Qing Zhao mailto:qing.z...@oracle.com>> > Date: Friday, September 4, 2020 at 9:19 AM > To: "Rodriguez Bahena, Victor" <mailto:victor.rodriguez.bah...@intel.com&

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-08 Thread Qing Zhao via Gcc-patches
> On Sep 7, 2020, at 10:58 AM, H.J. Lu wrote: > > On Mon, Sep 7, 2020 at 7:06 AM Segher Boessenkool > mailto:seg...@kernel.crashing.org>> wrote: >> >> On Fri, Sep 04, 2020 at 11:52:13AM -0700, H.J. Lu wrote: >>> On Fri, Sep 4, 2020 at 11:09 AM Segher Boessenkool >>> wrote: On Fri, Sep 0

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-10 Thread Qing Zhao via Gcc-patches
Richard, Thank you! > On Sep 10, 2020, at 7:11 AM, Richard Sandiford > wrote: > > Patrick McGehearty via Gcc-patches writes: >> My understanding is this feature/flag is not intended to be "default on". >> It is intended to be used in security sensitive environments such >> as the Linux kernel

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-10 Thread Qing Zhao via Gcc-patches
> On Sep 10, 2020, at 2:07 PM, Kees Cook wrote: > > [tried to clean up quoting...] > > On Tue, Sep 08, 2020 at 10:00:09AM -0500, Qing Zhao wrote: >> >>> On Sep 7, 2020, at 8:06 AM, Rodriguez Bahena, Victor >>> wrote: >>> >>>>

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-10 Thread Qing Zhao via Gcc-patches
> On Sep 10, 2020, at 5:05 PM, Segher Boessenkool > wrote: > > On Tue, Sep 08, 2020 at 11:43:30AM -0500, Qing Zhao wrote: >>> On Sep 7, 2020, at 10:58 AM, H.J. Lu wrote: >>> On Mon, Sep 7, 2020 at 7:06 AM Segher Boessenkool >>> mailto:seg...@kernel.cr

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-11 Thread Qing Zhao via Gcc-patches
> On Sep 11, 2020, at 11:14 AM, Segher Boessenkool > wrote: > > On Fri, Sep 11, 2020 at 11:06:03AM +0100, Richard Sandiford wrote: >> This might have already been discussed/answered, sorry, but: >> when there's a choice, is there an obvious winner between: >> >> (1) clearing call-clobbered r

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-11 Thread Qing Zhao via Gcc-patches
> On Sep 11, 2020, at 12:13 PM, Segher Boessenkool > wrote: > > On Fri, Sep 11, 2020 at 11:52:29AM -0500, Qing Zhao wrote: >> I don’t understand why it’s not correct if we clearing call-clobbered >> registers >> AFTER restoring call-preserved registers? >

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-11 Thread Qing Zhao via Gcc-patches
> On Sep 11, 2020, at 12:18 PM, Segher Boessenkool > wrote: > > On Thu, Sep 10, 2020 at 05:50:40PM -0500, Qing Zhao wrote: >>>>>> Shrink-wrapped stuff. Quite important for performance. Not something >>>>>> you can throw away. > >

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-11 Thread Qing Zhao via Gcc-patches
> On Sep 11, 2020, at 12:32 PM, Richard Sandiford > wrote: > > Qing Zhao writes: >>> On Sep 11, 2020, at 11:14 AM, Segher Boessenkool >>> wrote: >>> >>> On Fri, Sep 11, 2020 at 11:06:03AM +0100, Richard Sandiford wrote: >>>>

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-11 Thread Qing Zhao via Gcc-patches
> On Sep 11, 2020, at 3:05 PM, Segher Boessenkool > wrote: > > On Fri, Sep 11, 2020 at 02:40:06PM -0500, Qing Zhao wrote: >>> On Sep 11, 2020, at 12:13 PM, Segher Boessenkool >>> wrote: >>> On Fri, Sep 11, 2020 at 11:52:29AM -0500, Qing Zhao wrot

[Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-07-14 Thread Qing Zhao via Gcc-patches
know any more comment? thanks. Qing gcc/ChangeLog: 2020-07-13 qing zhao mailto:qing.z...@oracle.com>> 2020-07-13 H.J. Lu mailto:hjl.to...@gmail.com>> * common.opt: Add new option -fzero-call-used-regs. * config/i386/i386.c (i

Re: [stage1][PATCH] Change semantics of -frecord-gcc-switches and add -frecord-gcc-switches-format.

2020-07-21 Thread Qing Zhao via Gcc-patches
PING^4. Our company is waiting for this patch to be committed to upstream. Thanks a lot. Qing > On Jun 16, 2020, at 7:49 AM, Martin Liška wrote: > > PING^3 > > On 6/2/20 11:16 AM, Martin Liška wrote: >> PING^2 >> On 5/15/20 11:58 AM, Martin Liška wrote: >>> We're in stage1: PING^1 >>> >>>

Re: [stage1][PATCH] Change semantics of -frecord-gcc-switches and add -frecord-gcc-switches-format.

2020-07-23 Thread Qing Zhao via Gcc-patches
Hi, Thanks a lot for the info. > On Jul 23, 2020, at 5:07 AM, Martin Liška wrote: > > On 7/21/20 6:24 PM, Qing Zhao wrote: >> 4. >> Our company is waiting for this patch to be committed to upstream. > > Hello. > > Please note that patch review can sometimes t

PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-07-28 Thread Qing Zhao via Gcc-patches
On Jul 14, 2020, at 9:45 AM, Qing Zhao via Gcc-patches > wrote: > > Hi, Gcc team, > > This patch is a follow-up on the previous patch and corresponding discussion: > https://gcc.gnu.org/pipermail/gcc-patches/2020-May/545101.html > <https://gcc.gnu.org/pipermail/gcc-p

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-03 Thread Qing Zhao via Gcc-patches
jul. 2020 je oseba Qing Zhao <mailto:qing.z...@oracle.com>> napisala: > > > > > > Richard and Uros, > > > > Could you please review the change that H.J and I rewrote based on your > > comments in the previous round of discussion? > > > > This

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-05 Thread Qing Zhao via Gcc-patches
> On Aug 5, 2020, at 9:45 AM, H.J. Lu wrote: > > On Wed, Aug 5, 2020 at 5:34 AM H.J. Lu > wrote: >> >> On Wed, Aug 5, 2020 at 5:31 AM Richard Biener wrote: >>> >>> >>> [PATCH] Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all] >>

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-05 Thread Qing Zhao via Gcc-patches
>> >> From The SECURE project and GCC in GCC Cauldron 2018: >> >> Speaker: Graham Markall >> >> The SECURE project is a 15 month program funded by Innovate UK, to >> take well known security techniques from academia and make them >> generally available in standard compilers, specfically GCC and

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-05 Thread Qing Zhao via Gcc-patches
Hi, Richard, Thanks a lot for your careful review and detailed comments. > On Aug 4, 2020, at 2:35 AM, Richard Biener wrote: > > I have a few comments below - I'm not sure I'm qualified to fully > review the rest though. Could you let me know who will be the more qualified person to fully r

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-06 Thread Qing Zhao via Gcc-patches
> On Aug 6, 2020, at 3:31 AM, Richard Biener wrote: > > On Wed, 5 Aug 2020, Qing Zhao wrote: > >> Hi, Richard, >> >> Thanks a lot for your careful review and detailed comments. >> >> >>> On Aug 4, 2020, at 2:35 AM, Richard Biener >

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-06 Thread Qing Zhao via Gcc-patches
> On Aug 6, 2020, at 3:37 AM, Richard Biener wrote: > > On Wed, 5 Aug 2020, Qing Zhao wrote: > >>>> >>>> From The SECURE project and GCC in GCC Cauldron 2018: >>>> >>>> Speaker: Graham Markall >>>> >>>&g

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-06 Thread Qing Zhao via Gcc-patches
Hi, Richard, > On Aug 5, 2020, at 4:35 PM, Qing Zhao via Gcc-patches > wrote: > > >> >>>>>> + continue; >>>>>> + if (fixed_regs[regno]) >>>>>> + continue; >>>>>> + if (is_live_

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-07 Thread Qing Zhao via Gcc-patches
Hi, Segher, Thanks for your comments. > On Aug 6, 2020, at 6:37 PM, Segher Boessenkool > wrote: > > Hi! > > On Thu, Aug 06, 2020 at 10:31:27AM +0200, Richard Biener wrote: >> Jeff might be, but with the intended purpose (ROP mitigation AFAIU) >> it would be nice for other target maintainers t

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-07 Thread Qing Zhao via Gcc-patches
> On Aug 7, 2020, at 1:21 AM, Richard Biener wrote: > > On Thu, 6 Aug 2020, Kees Cook wrote: > >> On Thu, Aug 06, 2020 at 10:37:43AM +0200, Richard Biener wrote: >>> OK, so -fzero-call-used-regs is a ROP mitigation technique. To me >>> it sounded more like a mitigation against information le

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-08-07 Thread Qing Zhao via Gcc-patches
Hi, Alexandre, Thank you for the comments and suggestions. > On Aug 7, 2020, at 8:20 AM, Alexandre Oliva wrote: > > On Jul 28, 2020, Qing Zhao via Gcc-patches wrote: > >>> 2. The main code generation part is moved from i386 backend to middle-end; >>> 3. Add 4

[PATCH][gcc][PR94230]provide an option to change the size limitation for -Wmisleading-indent

2020-04-03 Thread Qing Zhao via Gcc-patches
Hi, David and Jakub, Per the discussion we had for PR94230: provide an option to change the size limitation for -Wmisleading-indent https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94230 I come up with the following simple patch per David’s sugge

PING [PATCH][gcc][PR94230]provide an option to change the size limitation for -Wmisleading-indent

2020-04-08 Thread Qing Zhao via Gcc-patches
Hi, Please take a look at the attached patch and let me know your comments. Thanks. Qing gcc/ChangeLog: 2020-04-03 qing zhao * common.opt: Add -flocation-ranges. * doc/invoke.texi: Document it. * toplev.c (process_options): set line_table->default_range_b

Fwd: PING [PATCH][gcc][PR94230]provide an option to change the size limitation for -Wmisleading-indent

2020-04-15 Thread Qing Zhao via Gcc-patches
Ping. We need this patch for our product building. thanks. Qing > Begin forwarded message: > > From: Qing Zhao via Gcc-patches > Subject: PING [PATCH][gcc][PR94230]provide an option to change the size > limitation for -Wmisleading-indent > Date: April 8, 2020 at 2:39:22

[PATCH][x86][3/3]: Add -mzero-caller-saved-regs=[skip|used-gpr|all-gpr|used|all]

2020-04-17 Thread Qing Zhao via Gcc-patches
Hi, This is the 3rd patch of the total 3 patches set for providing the new feature -mzero-caller-saved-regs for linux kernel security improvement. This patch is to Update gcc.target/i386/ret-thunk-2[234].c Qing 0003-Update-gcc.target-i386-ret-thunk-2-234-.c.patch Description: Binary data

[PATCH][x86][2/3]: Add -mzero-caller-saved-regs=[skip|used-gpr|all-gpr|used|all]

2020-04-17 Thread Qing Zhao via Gcc-patches
Hi, This is the 2nd patch of the total 3 patches set for providing the new feature -mzero-caller-saved-regs for linux kernel security improvement. This patch is for resolving the new regressions triggered by the first patch. This patch is to Add ix86_any_return_p to check simple_return in a PA

[PATCH][x86][1/3]: Add -mzero-caller-saved-regs=[skip|used-gpr|all-gpr|used|all]

2020-04-17 Thread Qing Zhao via Gcc-patches
Hi, This is a PING for an old patch proposed by H. J. Lu on Oct, 2018: https://gcc.gnu.org/legacy-ml/gcc-patches/2018-10/msg02079.html This is the first patch of the total 3 patches set, which provides the following new feature: -mzero-caller-saved-regs=[skip|used-gpr|all-gpr|used|all] co

Re: PING [PATCH][gcc][PR94230]provide an option to change the size limitation for -Wmisleading-indent

2020-04-22 Thread Qing Zhao via Gcc-patches
Hi, Richard And Dave: Thanks a lot for the review and comments. > On Apr 21, 2020, at 1:46 PM, Richard Sandiford > wrote: > > David Malcolm writes: >> On Tue, 2020-04-21 at 15:04 +0100, Richard Sandiford wrote >>> >>> Please add: >>> >>> PR c/94230 Will do. >>> * common.opt:

[Version 2][PATCH][gcc][PR94230]provide an option to change the size limitation for -Wmisleading-indent

2020-04-23 Thread Qing Zhao via Gcc-patches
. Documentation for this new option; 4. Update the testing case location-overflow-test-1.c to include the new hint. Please take a look at this new patch and let me know any new comment. thanks. Qing. gcc/ChangeLog: 2020-04-22 qing zhao PR c/94230 * common.opt: Add -flarge-source-files

Re: [Version 2][PATCH][gcc][PR94230]provide an option to change the size limitation for -Wmisleading-indent

2020-04-23 Thread Qing Zhao via Gcc-patches
Hi, Richard, > On Apr 23, 2020, at 1:27 PM, Richard Sandiford > wrote: > > Qing Zhao writes: >> --- >> gcc/c-family/c-indentation.c | 3 +++ >> gcc/common.opt |

[Version 3][PATCH][gcc][PR94230]provide an option to change the size limitation for -Wmisleading-indent

2020-04-23 Thread Qing Zhao via Gcc-patches
Hi, Richard, This is the 3rd version of the patch, updated based on your previous comments. Please take a look at it and let me know whether it’s okay to commit? Thanks a lot for all your help. Qing. gcc/ChangeLog: 2020-04-22 qing zhao PR c/94230 * common.opt: Add -flarge

[Version 4][PATCH][gcc][PR94230]provide an option to change the size limitation for -Wmisleading-indent

2020-04-24 Thread Qing Zhao via Gcc-patches
. Qing gcc/c-family/ChangeLog: 2020-04-24 qing zhao * c-indentation.c (get_visual_column): Add a hint to use the new -flarge-source-files option. gcc/ChangeLog: 2020-04-24 qing zhao * common.opt: Add -flarge-source-files. * doc/invoke.texi: Document it

Re: [Version 4][PATCH][gcc][PR94230]provide an option to change the size limitation for -Wmisleading-indent

2020-04-27 Thread Qing Zhao via Gcc-patches
Hi, David, > On Apr 24, 2020, at 5:36 PM, David Malcolm wrote: > > On Fri, 2020-04-24 at 17:22 -0500, Qing Zhao wrote: >> Hi, Dave, >> >> Thanks a lot for the review and comments. >> I just updated the patch with all your suggestions, bootstrapped it >>

<    7   8   9   10   11   12   13   14   15   >