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

2020-09-23 Thread Segher Boessenkool
Hi! On Wed, Sep 23, 2020 at 12:05:22PM +0100, Richard Sandiford wrote: > Qing Zhao writes: > > (But I do feel that the design for UNSPEC_volatile is not clean) > > Agreed. But I think that's partly because what it's trying to achieve > isn't clean either. It's a catch-all for “something is

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

2020-09-23 Thread Segher Boessenkool
On Wed, Sep 23, 2020 at 09:28:33AM -0500, Qing Zhao wrote: > > On Sep 22, 2020, at 5:37 PM, Segher Boessenkool > > wrote: > >> which is very similar to the unspec_volatile case we're talking about. > > > > So just like volatile memory accesses, they have an (unknown) side > > effect, which

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

2020-09-23 Thread Qing Zhao via Gcc-patches
> On Sep 23, 2020, at 10:21 AM, Richard Sandiford > wrote: > > Qing Zhao mailto:qing.z...@oracle.com>> writes: >>> On Sep 23, 2020, at 9:32 AM, Richard Sandiford >>> wrote: >>> >>> Qing Zhao writes: > On Sep 23, 2020, at 6:05 AM, Richard Sandiford > wrote: > > Qing

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

2020-09-23 Thread Richard Sandiford
Qing Zhao writes: >> On Sep 23, 2020, at 9:32 AM, Richard Sandiford >> wrote: >> >> Qing Zhao writes: On Sep 23, 2020, at 6:05 AM, Richard Sandiford wrote: Qing Zhao mailto:qing.z...@oracle.com>> writes: >> On Sep 22, 2020, at 12:06 PM, Richard Sandiford >>

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

2020-09-23 Thread Qing Zhao via Gcc-patches
> On Sep 23, 2020, at 9:40 AM, Richard Sandiford > wrote: > > Qing Zhao writes: > Dropping them is fine with me FWIW. That seems like a natural use > for the new hook: drop zeroing that isn't actively wrong, but isn't > likely to be useful either. Okay, I will add a

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

2020-09-23 Thread Qing Zhao via Gcc-patches
> On Sep 23, 2020, at 9:32 AM, Richard Sandiford > wrote: > > Qing Zhao writes: >>> On Sep 23, 2020, at 6:05 AM, Richard Sandiford >>> wrote: >>> >>> Qing Zhao mailto:qing.z...@oracle.com>> writes: > On Sep 22, 2020, at 12:06 PM, Richard Sandiford > wrote:

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

2020-09-23 Thread Richard Sandiford
Qing Zhao writes: Dropping them is fine with me FWIW. That seems like a natural use for the new hook: drop zeroing that isn't actively wrong, but isn't likely to be useful either. >>> >>> Okay, I will add a new hook for this purpose. >> >> It doesn't need to be a new hook. The

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

2020-09-23 Thread Qing Zhao via Gcc-patches
> On Sep 23, 2020, at 9:22 AM, Richard Sandiford > wrote: > > Qing Zhao mailto:qing.z...@oracle.com>> writes: >>> On Sep 23, 2020, at 5:43 AM, Richard Sandiford >>> wrote: >>> >>> Qing Zhao writes: > On Sep 22, 2020, at 1:35 PM, H.J. Lu wrote: > On Tue, Sep 22, 2020 at 11:25 AM

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

2020-09-23 Thread Richard Sandiford
Qing Zhao writes: >> On Sep 23, 2020, at 6:05 AM, Richard Sandiford >> wrote: >> >> Qing Zhao mailto:qing.z...@oracle.com>> writes: On Sep 22, 2020, at 12:06 PM, Richard Sandiford wrote: >>> >>> The following is what I see from i386.md: (I didn’t look at how >>>

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

2020-09-23 Thread Qing Zhao via Gcc-patches
> On Sep 22, 2020, at 5:37 PM, Segher Boessenkool > wrote: > > Hi! > > On Tue, Sep 22, 2020 at 06:06:30PM +0100, Richard Sandiford wrote: >> Qing Zhao writes: >>> Okay, thanks for the info. >>> then, what’s the current definition of UNSPEC_VOLATILE? >> >> I'm not sure it's written down

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

2020-09-23 Thread Richard Sandiford
Qing Zhao writes: >> On Sep 23, 2020, at 5:43 AM, Richard Sandiford >> wrote: >> >> Qing Zhao writes: On Sep 22, 2020, at 1:35 PM, H.J. Lu wrote: On Tue, Sep 22, 2020 at 11:25 AM Qing Zhao >>> > wrote: >> On Sep 22, 2020, at 11:31 AM, Richard

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

2020-09-23 Thread Qing Zhao via Gcc-patches
> On Sep 23, 2020, at 6:05 AM, Richard Sandiford > wrote: > > Qing Zhao mailto:qing.z...@oracle.com>> writes: >>> On Sep 22, 2020, at 12:06 PM, Richard Sandiford >>> wrote: >> >> The following is what I see from i386.md: (I didn’t look at how >> “UNSPEC_volatile” is used in

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

2020-09-23 Thread Qing Zhao via Gcc-patches
> On Sep 23, 2020, at 5:43 AM, Richard Sandiford > wrote: > > Qing Zhao writes: >>> On Sep 22, 2020, at 1:35 PM, H.J. Lu wrote: >>> On Tue, Sep 22, 2020 at 11:25 AM Qing Zhao >> > wrote: > On Sep 22, 2020, at 11:31 AM, Richard Sandiford > wrote: >

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

2020-09-23 Thread Richard Sandiford
Qing Zhao writes: >> On Sep 22, 2020, at 12:06 PM, Richard Sandiford >> wrote: > > The following is what I see from i386.md: (I didn’t look at how > “UNSPEC_volatile” is used in data flow analysis in GCC yet) > > ;; UNSPEC_VOLATILE is considered to use and clobber all

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

2020-09-23 Thread Richard Sandiford
Qing Zhao writes: >> On Sep 22, 2020, at 1:35 PM, H.J. Lu wrote: >> On Tue, Sep 22, 2020 at 11:25 AM Qing Zhao > > wrote: On Sep 22, 2020, at 11:31 AM, Richard Sandiford wrote: Taking each in turn: what is the reason for not clearing mask registers?

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

2020-09-22 Thread Segher Boessenkool
Hi! On Tue, Sep 22, 2020 at 06:06:30PM +0100, Richard Sandiford wrote: > Qing Zhao writes: > > Okay, thanks for the info. > > then, what’s the current definition of UNSPEC_VOLATILE? > > I'm not sure it's written down anywhere TBH. rtl.texi just says: > > @code{unspec_volatile} is used for

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

2020-09-22 Thread Qing Zhao via Gcc-patches
> On Sep 22, 2020, at 12:06 PM, Richard Sandiford > wrote: The following is what I see from i386.md: (I didn’t look at how “UNSPEC_volatile” is used in data flow analysis in GCC yet) ;; UNSPEC_VOLATILE is considered to use and clobber all hard registers and ;;

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

2020-09-22 Thread Qing Zhao via Gcc-patches
> On Sep 22, 2020, at 1:35 PM, H.J. Lu wrote: > > On Tue, Sep 22, 2020 at 11:25 AM Qing Zhao > wrote: >> >> Hi, Hongjiu, >> >> >>> On Sep 22, 2020, at 11:31 AM, Richard Sandiford >>> wrote: >>> >>> Qing Zhao writes: > On Sep 21, 2020, at 2:22 PM, Qing

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

2020-09-22 Thread H.J. Lu via Gcc-patches
On Tue, Sep 22, 2020 at 11:25 AM Qing Zhao wrote: > > Hi, Hongjiu, > > > > On Sep 22, 2020, at 11:31 AM, Richard Sandiford > > wrote: > > > > Qing Zhao writes: > >>> On Sep 21, 2020, at 2:22 PM, Qing Zhao via Gcc-patches > >>> wrote: > >>> > >>> > >>> > On Sep 21, 2020, at 2:11 PM,

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

2020-09-22 Thread Qing Zhao via Gcc-patches
Hi, Hongjiu, > On Sep 22, 2020, at 11:31 AM, Richard Sandiford > wrote: > > Qing Zhao writes: >>> On Sep 21, 2020, at 2:22 PM, Qing Zhao via Gcc-patches >>> wrote: >>> >>> >>> On Sep 21, 2020, at 2:11 PM, Richard Sandiford wrote: Qing Zhao writes: >> But in

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

2020-09-22 Thread Richard Sandiford
Qing Zhao writes: >> On Sep 17, 2020, at 11:27 AM, Richard Sandiford >> wrote: >> >> Qing Zhao mailto:qing.z...@oracle.com>> writes: On Sep 17, 2020, at 1:17 AM, Richard Sandiford wrote: Qing Zhao writes: > Segher and Richard, > > Now there are two major

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

2020-09-22 Thread Richard Sandiford
Qing Zhao writes: >> On Sep 21, 2020, at 2:22 PM, Qing Zhao via Gcc-patches >> wrote: >> >> >> >>> On Sep 21, 2020, at 2:11 PM, Richard Sandiford >>> wrote: >>> >>> Qing Zhao writes: > But in cases where there is no underlying concept that can sensibly > be extracted out, it's OK

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

2020-09-21 Thread Segher Boessenkool
On Mon, Sep 21, 2020 at 03:58:25PM -0500, Qing Zhao wrote: > > On Sep 21, 2020, at 3:34 PM, Segher Boessenkool > > wrote: > > But you cannot *add* anything with this interface, and it cannot return > > different results depending on which return insn this is. It is not a > > good abstraction

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

2020-09-21 Thread Qing Zhao via Gcc-patches
> On Sep 21, 2020, at 3:34 PM, Segher Boessenkool > wrote: > > On Mon, Sep 21, 2020 at 09:13:58AM -0500, Qing Zhao wrote: >>> On Sep 18, 2020, at 5:51 PM, Segher Boessenkool >>> wrote: B. Will provide a default definition in middle end to generate the zeroing insn for selected

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

2020-09-21 Thread Segher Boessenkool
On Mon, Sep 21, 2020 at 09:13:58AM -0500, Qing Zhao wrote: > > On Sep 18, 2020, at 5:51 PM, Segher Boessenkool > > wrote: > >> B. Will provide a default definition in middle end to generate the > >> zeroing insn for selected registers. Then need to add a new target hook > >>

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

2020-09-21 Thread Qing Zhao via Gcc-patches
> On Sep 21, 2020, at 2:22 PM, Qing Zhao via Gcc-patches > wrote: > > > >> On Sep 21, 2020, at 2:11 PM, Richard Sandiford >> wrote: >> >> Qing Zhao writes: But in cases where there is no underlying concept that can sensibly be extracted out, it's OK if targets need to

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

2020-09-21 Thread Qing Zhao via Gcc-patches
> On Sep 21, 2020, at 2:11 PM, Richard Sandiford > wrote: > > Qing Zhao writes: >>> But in cases where there is no underlying concept that can sensibly >>> be extracted out, it's OK if targets need to override the default >>> to get correct behaviour. >> >> Then, on the target that the

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

2020-09-21 Thread Richard Sandiford
Qing Zhao writes: >> But in cases where there is no underlying concept that can sensibly >> be extracted out, it's OK if targets need to override the default >> to get correct behaviour. > > Then, on the target that the default code is not right, and we haven’t > provide overridden

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

2020-09-21 Thread Qing Zhao via Gcc-patches
> On Sep 21, 2020, at 10:35 AM, Richard Sandiford > wrote: > > Qing Zhao writes: >> My major concern with the default implementation of the hook is: >> >> If a target has some special registers that should not be zeroed, and we do >> not provide an overridden implementation for this

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

2020-09-21 Thread Richard Sandiford
Qing Zhao writes: > My major concern with the default implementation of the hook is: > > If a target has some special registers that should not be zeroed, and we do > not provide an overridden implementation for this target, then the default > implementation will generate incorrect code for

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

2020-09-21 Thread Qing Zhao via Gcc-patches
> On Sep 21, 2020, at 2:23 AM, Richard Sandiford > wrote: > > Qing Zhao mailto:qing.z...@oracle.com>> writes: >> Hi, Richard, >> >> During my implementation of the new version of the patch. I still feel that >> it’s not practical to add a default definition in the middle end to just use

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

2020-09-21 Thread Qing Zhao via Gcc-patches
> On Sep 18, 2020, at 5:51 PM, Segher Boessenkool > wrote: > > Hi! > > On Fri, Sep 18, 2020 at 03:31:12PM -0500, Qing Zhao wrote: >> Let me know your opinion: >> >> A. Will not provide default definition in middle end to generate the >> zeroing insn for selected registers. Move the

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

2020-09-21 Thread Richard Sandiford
Qing Zhao writes: > Hi, Richard, > > During my implementation of the new version of the patch. I still feel that > it’s not practical to add a default definition in the middle end to just use > move patterns to zero each selected register. > > The major issues are: > > There are some target

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

2020-09-18 Thread Segher Boessenkool
Hi! On Fri, Sep 18, 2020 at 03:31:12PM -0500, Qing Zhao wrote: > Let me know your opinion: > > A. Will not provide default definition in middle end to generate the zeroing > insn for selected registers. Move the generation work all to target; X86 > implementation will be provided; > > OR: >

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

2020-09-18 Thread Qing Zhao via Gcc-patches
Hi, Richard, During my implementation of the new version of the patch. I still feel that it’s not practical to add a default definition in the middle end to just use move patterns to zero each selected register. The major issues are: There are some target specific information on how to

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

2020-09-17 Thread Segher Boessenkool
On Thu, Sep 17, 2020 at 05:27:59PM +0100, Richard Sandiford wrote: > Qing Zhao writes: > > The following is what I see from i386.md: (I didn’t look at how > > “UNSPEC_volatile” is used in data flow analysis in GCC yet) > > > > ;; UNSPEC_VOLATILE is considered to use and clobber all hard

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

2020-09-17 Thread Qing Zhao via Gcc-patches
> On Sep 17, 2020, at 11:27 AM, Richard Sandiford > wrote: > > Qing Zhao mailto:qing.z...@oracle.com>> writes: >>> On Sep 17, 2020, at 1:17 AM, Richard Sandiford >>> wrote: >>> >>> Qing Zhao writes: Segher and Richard, Now there are two major concerns from the discussion

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

2020-09-17 Thread Richard Sandiford
Qing Zhao writes: >> On Sep 17, 2020, at 1:17 AM, Richard Sandiford >> wrote: >> >> Qing Zhao writes: >>> Segher and Richard, >>> >>> Now there are two major concerns from the discussion so far: >>> >>> 1. (From Richard): Inserting zero insns should be done after >>>

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

2020-09-17 Thread Qing Zhao via Gcc-patches
> On Sep 17, 2020, at 1:17 AM, Richard Sandiford > wrote: > > Qing Zhao writes: >> Segher and Richard, >> >> Now there are two major concerns from the discussion so far: >> >> 1. (From Richard): Inserting zero insns should be done after >> pass_thread_prologue_and_epilogue since later

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

2020-09-17 Thread Richard Sandiford
Qing Zhao writes: > Segher and Richard, > > Now there are two major concerns from the discussion so far: > > 1. (From Richard): Inserting zero insns should be done after > pass_thread_prologue_and_epilogue since later passes (for example, > pass_regrename) might introduce new used

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

2020-09-16 Thread Qing Zhao via Gcc-patches
Segher and Richard, Now there are two major concerns from the discussion so far: 1. (From Richard): Inserting zero insns should be done after pass_thread_prologue_and_epilogue since later passes (for example, pass_regrename) might introduce new used caller-saved registers. So, we

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

2020-09-16 Thread Segher Boessenkool
On Tue, Sep 15, 2020 at 08:51:57PM -0500, Qing Zhao wrote: > > On Sep 15, 2020, at 6:09 PM, Segher Boessenkool > > wrote: > > If you want the zeroing insns to stay with the return, you have to > > express that in RTL. > > What do you mean by “express that in RTL”? > Could you please explain

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

2020-09-15 Thread Qing Zhao via Gcc-patches
> On Sep 15, 2020, at 6:09 PM, Segher Boessenkool > wrote: > > On Tue, Sep 15, 2020 at 05:31:48PM -0500, Qing Zhao wrote: >>> But, scheduling runs *after* that, and then you need to prevent the >>> inserted (zeroing) insns from moving -- if you don't, the code after >>> some zeroing can be

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

2020-09-15 Thread Segher Boessenkool
On Tue, Sep 15, 2020 at 05:31:48PM -0500, Qing Zhao wrote: > > But, scheduling runs *after* that, and then you need to prevent the > > inserted (zeroing) insns from moving -- if you don't, the code after > > some zeroing can be used as gadget! You want to always have all > > zeroing insns after

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

2020-09-15 Thread Qing Zhao via Gcc-patches
> On Sep 15, 2020, at 2:41 PM, Segher Boessenkool > wrote: > > On Tue, Sep 15, 2020 at 10:11:41AM +0100, Richard Sandiford wrote: >> Qing Zhao writes: On Sep 14, 2020, at 2:20 PM, Richard Sandiford wrote: > (Putting correct info in DF, inserting the new insns in pro_and_epi). >

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

2020-09-15 Thread Segher Boessenkool
On Tue, Sep 15, 2020 at 10:11:41AM +0100, Richard Sandiford wrote: > Qing Zhao writes: > >> On Sep 14, 2020, at 2:20 PM, Richard Sandiford > >> wrote: (Putting correct info in DF, inserting the new insns in pro_and_epi). But, scheduling runs *after* that, and then you need to prevent the

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

2020-09-15 Thread Segher Boessenkool
On Tue, Sep 15, 2020 at 12:46:00PM +0100, Richard Sandiford wrote: > Segher Boessenkool writes: > > On Mon, Sep 14, 2020 at 05:33:33PM +0100, Richard Sandiford wrote: > >> > However, for the cases on Power as Segher mentioned, there are also some > >> > scratch registers used for > >> > Other

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

2020-09-15 Thread Segher Boessenkool
On Mon, Sep 14, 2020 at 10:07:31PM -0500, Qing Zhao wrote: > > On Sep 14, 2020, at 6:09 PM, Segher Boessenkool > > wrote: > >> Gadget 1: > >> > >> mov rax, value > >> syscall > >> ret > > > > No, just > > > > mov rax,59 > > syscall > > > > (no ret necessary!) > > But for ROP, a typical

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

2020-09-15 Thread Qing Zhao via Gcc-patches
> On Sep 15, 2020, at 4:11 AM, Richard Sandiford > wrote: > > Qing Zhao mailto:qing.z...@oracle.com>> writes: >>> On Sep 14, 2020, at 2:20 PM, Richard Sandiford >>> wrote: >>> >>> Qing Zhao mailto:qing.z...@oracle.com>> writes: > On Sep 14, 2020, at 11:33 AM, Richard Sandiford >

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

2020-09-15 Thread Richard Sandiford
Segher Boessenkool writes: > On Mon, Sep 14, 2020 at 05:33:33PM +0100, Richard Sandiford wrote: >> > However, for the cases on Power as Segher mentioned, there are also some >> > scratch registers used for >> > Other purpose, not sure whether we can correctly generate zeroing in >> > middle-end

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

2020-09-15 Thread Richard Sandiford
Qing Zhao writes: >> On Sep 14, 2020, at 2:20 PM, Richard Sandiford >> wrote: >> >> Qing Zhao mailto:qing.z...@oracle.com>> writes: On Sep 14, 2020, at 11:33 AM, Richard Sandiford wrote: Qing Zhao writes: >> Like I mentioned earlier though, passes that run after

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

2020-09-14 Thread Qing Zhao via Gcc-patches
> On Sep 14, 2020, at 6:09 PM, Segher Boessenkool > wrote: > > On Fri, Sep 11, 2020 at 05:41:47PM -0500, Qing Zhao wrote: >>> On Sep 11, 2020, at 4:51 PM, Segher Boessenkool >>> wrote: >>> It is definitely *not* effective if there are gadgets that set rax to >>> a value the attacker wants

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

2020-09-14 Thread Segher Boessenkool
On Mon, Sep 14, 2020 at 05:33:33PM +0100, Richard Sandiford wrote: > > However, for the cases on Power as Segher mentioned, there are also some > > scratch registers used for > > Other purpose, not sure whether we can correctly generate zeroing in > > middle-end for Power? > > Segher would be

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

2020-09-14 Thread Segher Boessenkool
Hi! On Fri, Sep 11, 2020 at 05:24:58PM -0500, Qing Zhao wrote: > > So IMO the pass should just search for all the > > returns in a function and insert the zeroing instructions before > > each one. > > I was considering this approach too for some time, however, there is one > major issue with

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

2020-09-14 Thread Segher Boessenkool
On Fri, Sep 11, 2020 at 05:41:47PM -0500, Qing Zhao wrote: > > On Sep 11, 2020, at 4:51 PM, Segher Boessenkool > > wrote: > > It is definitely *not* effective if there are gadgets that set rax to > > a value the attacker wants and then do a syscall. > > You mean the following gadget: > > >

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

2020-09-14 Thread Qing Zhao via Gcc-patches
> On Sep 14, 2020, at 2:20 PM, Richard Sandiford > wrote: > > Qing Zhao mailto:qing.z...@oracle.com>> writes: >>> On Sep 14, 2020, at 11:33 AM, Richard Sandiford >>> wrote: >>> >>> Qing Zhao writes: > Like I mentioned earlier though, passes that run after >

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

2020-09-14 Thread Richard Sandiford
Qing Zhao writes: >> On Sep 14, 2020, at 11:33 AM, Richard Sandiford >> wrote: >> >> Qing Zhao writes: Like I mentioned earlier though, passes that run after pass_thread_prologue_and_epilogue can use call-clobbered registers that weren't previously used. For example, on

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

2020-09-14 Thread Qing Zhao via Gcc-patches
> On Sep 14, 2020, at 11:33 AM, Richard Sandiford > wrote: > > Qing Zhao writes: >>> Like I mentioned earlier though, passes that run after >>> pass_thread_prologue_and_epilogue can use call-clobbered registers that >>> weren't previously used. For example, on x86_64, the function might

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

2020-09-14 Thread Richard Sandiford
Qing Zhao writes: >> Like I mentioned earlier though, passes that run after >> pass_thread_prologue_and_epilogue can use call-clobbered registers that >> weren't previously used. For example, on x86_64, the function might >> not use %r8 when the prologue, epilogue and returns are generated, >>

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

2020-09-14 Thread Qing Zhao via Gcc-patches
Hi, Richard, > On Sep 11, 2020, at 5:56 PM, Richard Sandiford > wrote: > > Qing Zhao mailto:qing.z...@oracle.com>> writes: >>> On Sep 11, 2020, at 4:44 PM, Richard Sandiford >>> wrote: >>> >>> Qing Zhao writes: > On Sep 11, 2020, at 12:32 PM, Richard Sandiford > >> If we go for

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

2020-09-11 Thread Richard Sandiford
Qing Zhao writes: >> On Sep 11, 2020, at 4:44 PM, Richard Sandiford >> wrote: >> >> Qing Zhao writes: On Sep 11, 2020, at 12:32 PM, Richard Sandiford >> If we go for (2), then I think it would be better to do it at the start of pass_late_compilation instead. (Some

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 4:51 PM, Segher Boessenkool > wrote: > > On Fri, Sep 11, 2020 at 04:29:16PM -0500, Qing Zhao wrote: >>> On Sep 11, 2020, at 4:03 PM, Segher Boessenkool >>> wrote: The parameters that are passed to sys call will be destroyed, therefore, the attack will

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 4:44 PM, Richard Sandiford > wrote: > > Qing Zhao writes: >>> On Sep 11, 2020, at 12:32 PM, Richard Sandiford >>> >> If we go for (2), then I think it would be better to do >>> it at the start of pass_late_compilation instead. (Some targets wouldn't >>> cope with

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

2020-09-11 Thread Segher Boessenkool
On Fri, Sep 11, 2020 at 04:29:16PM -0500, Qing Zhao wrote: > > On Sep 11, 2020, at 4:03 PM, Segher Boessenkool > > wrote: > >> The parameters that are passed to sys call will be destroyed, therefore, > >> the attack will likely failed. > > > > But you do not need more than one non-zero

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

2020-09-11 Thread Richard Sandiford
Qing Zhao writes: >> On Sep 11, 2020, at 12:32 PM, Richard Sandiford >> >> If we go for (2), then I think it would be better to do >> it at the start of pass_late_compilation instead. (Some targets wouldn't >> cope with doing it later.) The reason for doing it so late is that the >> set of

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 4:03 PM, Segher Boessenkool > wrote: > > Hi! > > On Fri, Sep 11, 2020 at 03:14:57PM -0500, Qing Zhao wrote: >> My understanding of how this scheme helps ROP is: the attacker usually uses >> scratch register to pass > > Help obstruct ROP ;-) Thanks for catching my

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:36 PM, Segher Boessenkool > wrote: > > On Fri, Sep 11, 2020 at 03:17:19PM -0500, Qing Zhao wrote: >>> 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

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

2020-09-11 Thread Segher Boessenkool
Hi! On Fri, Sep 11, 2020 at 03:14:57PM -0500, Qing Zhao wrote: > My understanding of how this scheme helps ROP is: the attacker usually uses > scratch register to pass Help obstruct ROP ;-) > parameters to the sys call in the gadget, if clearing the scratch registers > immediately before

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

2020-09-11 Thread Segher Boessenkool
On Fri, Sep 11, 2020 at 03:17:19PM -0500, Qing Zhao wrote: > > 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

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 wrote: I don’t understand why it’s not

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: This might have already been discussed/answered, sorry, but:

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

2020-09-11 Thread Segher Boessenkool
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 wrote: > >> I don’t understand why it’s not correct if we clearing call-clobbered > >> registers > >> AFTER

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

2020-09-11 Thread Segher Boessenkool
On Fri, Sep 11, 2020 at 06:32:56PM +0100, Richard Sandiford wrote: > Unlike Segher, I think this can/should be done in target-independent > code as far as possible (like the patch seemed to do). My problem with that is that it is both incorrect *and* inefficient. It writes registers it should

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. > > ^^^ !!! ^^^ > >>> Start looking at handle_simple_exit()?

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? > > Because the compiler backend

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

2020-09-11 Thread Richard Sandiford
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: >>> This might have already been discussed/answered, sorry, but: >>> when there's a choice, is there an obvious winner between: >>> >>> (1)

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

2020-09-11 Thread Segher Boessenkool
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. ^^^ !!! ^^^ > > Start looking at handle_simple_exit()? targetm.gen_simple_return()… > > Yes, I have been looking at this since

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

2020-09-11 Thread Segher Boessenkool
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? Because the compiler backend (or the linker! Or the dynamic linker! Etc.) can use volatile registers for

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

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

2020-09-11 Thread Segher Boessenkool
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 registers and then restoring call-preserved ones > (2) restoring

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

2020-09-11 Thread Richard Sandiford
Kees Cook via Gcc-patches writes: > [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: >> > >> >>> On Thu, Sep 03, 2020 at 09:29:54AM -0500, Qing Zhao wrote: >> >>> So, my

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.crashing.org>> wrote: On Fri, Sep 04,

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: >>> > On Thu, Sep 03, 2020 at 09:29:54AM -0500, Qing Zhao wrote:

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

2020-09-10 Thread Segher Boessenkool
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.crashing.org>> wrote: > >> On Fri, Sep 04, 2020 at 11:52:13AM -0700, H.J. Lu wrote: > >>> On Fri, Sep 4, 2020

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

2020-09-10 Thread Segher Boessenkool
On Tue, Sep 08, 2020 at 09:55:19AM -0500, Qing Zhao wrote: > Downloading this paper form IEEE needs a fee. Yes, and we cannot discuss it here. > What other information you need to show the effective of mitigation ROP > attack? Anything that we *can* talk about. Stuff we cannot talk about does

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

2020-09-10 Thread Kees Cook via Gcc-patches
[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: > > > >>> On Thu, Sep 03, 2020 at 09:29:54AM -0500, Qing Zhao wrote: > >>> So, my question is: > >>> > >>> From the security point of

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

2020-09-10 Thread Rodriguez Bahena, Victor via Gcc-patches
-Original Message- From: Qing Zhao Date: Thursday, September 10, 2020 at 9:34 AM To: Richard Sandiford , kees Cook , "Rodriguez Bahena, Victor" Cc: Patrick McGehearty via Gcc-patches Subject: Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gp

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

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

2020-09-10 Thread Richard Sandiford
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 where it was requested by kernel security experts. > I'm not understanding the objection

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

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

2020-09-08 Thread Patrick McGehearty via Gcc-patches
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 where it was requested by kernel security experts. I'm not understanding the objection here if the feature is requested by security teams

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
gt;>, Kees Cook <mailto:keesc...@chromium.org>> > Cc: Segher Boessenkool <mailto:seg...@kernel.crashing.org>>, Jakub Jelinek <mailto:ja...@redhat.com>>, Uros Bizjak <mailto:ubiz...@gmail.com>>, GCC Patches <mailto:gcc-patches@gcc.gnu.org>> &g

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. >>> >>> No, that is the number I meant. 2%

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

2020-09-07 Thread H.J. Lu via Gcc-patches
On Mon, Sep 7, 2020 at 7:06 AM Segher Boessenkool 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 04, 2020 at 10:34:23AM -0700, H.J. Lu wrote: > > > > > You probably have to do this for every

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

2020-09-07 Thread Segher Boessenkool
On Fri, Sep 04, 2020 at 01:23:14AM +, Rodriguez Bahena, Victor wrote: > Qing, thanks a lot for the measurement, I am not sure if this is the limit of > overhead the community is willing to accept by adding extra security (me as > gcc user will be willing to accept). The overhead is of

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

2020-09-07 Thread Segher Boessenkool
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. > > > > No, that is the number I meant. 2% overhead is extremely much, unless > > this is magically super

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

2020-09-07 Thread Segher Boessenkool
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 04, 2020 at 10:34:23AM -0700, H.J. Lu wrote: > > > > You probably have to do this for every target separately? But it is not > > > > enough to handle it in the

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

2020-09-07 Thread Rodriguez Bahena, Victor via Gcc-patches
From: Qing Zhao Date: Friday, September 4, 2020 at 9:19 AM To: "Rodriguez Bahena, Victor" , Kees Cook Cc: Segher Boessenkool , Jakub Jelinek , Uros Bizjak , GCC Patches Subject: Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all] On Sep 3,

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 >> -fzero-call-used-regs=all, the worst case

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

2020-09-04 Thread H.J. Lu via Gcc-patches
On Fri, Sep 4, 2020 at 11:09 AM Segher Boessenkool wrote: > > On Fri, Sep 04, 2020 at 10:34:23AM -0700, H.J. Lu wrote: > > > You probably have to do this for every target separately? But it is not > > > enough to handle it in the epilogue, you also need to make sure it is > > > done on every

  1   2   >