[PATCH 0/4] [rs6000] ROP support

2021-04-25 Thread Bill Schmidt via Gcc-patches
Add POWER10 support for hashst[p] and hashchk[p] operations. When the -mrop-protect option is selected, any function that loads the link register from memory before returning must have protection in the prologue and epilogue to ensure the link register save location has not been compromised. If

[PATCH 4/4] rs6000: Add ROP tests

2021-04-25 Thread Bill Schmidt via Gcc-patches
2021-03-25 Bill Schmidt gcc/testsuite/ * gcc.target/powerpc/rop-1.c: New. * gcc.target/powerpc/rop-2.c: New. * gcc.target/powerpc/rop-3.c: New. * gcc.target/powerpc/rop-4.c: New. * gcc.target/powerpc/rop-5.c: New. ---

[PATCH 2/4] rs6000: Emit ROP-protect instructions in prologue and epilogue

2021-04-25 Thread Bill Schmidt via Gcc-patches
Insert the hashst and hashchk instructions when -mrop-protect has been selected. The encrypted save slot for ROP mitigation is placed between the parameter save area and the alloca space (if any; otherwise the local variable space). Note that ROP-mitigation instructions are currently only

[PATCH 3/4] rs6000: Conditionally define __ROP_PROTECT__

2021-04-25 Thread Bill Schmidt via Gcc-patches
2021-03-25 Bill Schmidt gcc/ * config/rs6000/rs6000-c.c (rs6000_target_modify_macros): Define __ROP_PROTECT__ if -mrop-protect is selected. --- gcc/config/rs6000/rs6000-c.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/config/rs6000/rs6000-c.c

[PATCH 1/4] rs6000: Add -mrop-protect and -mprivileged flags

2021-04-25 Thread Bill Schmidt via Gcc-patches
2021-03-25 Bill Schmidt gcc/ * config/rs6000/rs6000.c (rs6000_option_override_internal): Disable shrink wrap when inserting ROP-protect instructions. * config/rs6000/rs6000.opt (mrop-protect): New option. (mprivileged): Likewise. * doc/invoke.texi:

[PATCH v2] Generate offset adjusted operation for op_by_pieces operations

2021-04-25 Thread H.J. Lu via Gcc-patches
On Fri, Apr 23, 2021 at 09:12:10AM +0200, Richard Biener wrote: > On Fri, Apr 23, 2021 at 1:35 AM H.J. Lu via Gcc-patches > wrote: > > > > For op_by_pieces operations between two areas of memory on non-strict > > alignment target, add -foverlap-op-by-pieces=[off|on|max-memset] to > > generate

RE: [RFC] bpf.2: Use standard types and attributes

2021-04-25 Thread David Laight via Gcc-patches
From: Zack Weinberg > Sent: 25 April 2021 20:17 > > On Sat, Apr 24, 2021 at 4:43 PM David Laight via Libc-alpha > wrote: > > From: Alexei Starovoitov > > > On Fri, Apr 23, 2021 at 4:15 PM Alejandro Colomar > > > wrote: > ... > > > > Some pages also document attributes, using GNU syntax > > > >

Re: [RFC] bpf.2: Use standard types and attributes

2021-04-25 Thread Zack Weinberg
On Sat, Apr 24, 2021 at 4:43 PM David Laight via Libc-alpha wrote: > From: Alexei Starovoitov > > On Fri, Apr 23, 2021 at 4:15 PM Alejandro Colomar > > wrote: ... > > > Some pages also document attributes, using GNU syntax > > > '__attribute__((xxx))'. Update those to use the shorter and more

Re: [RFC] bpf.2: Use standard types and attributes

2021-04-25 Thread Zack Weinberg
On Sun, Apr 25, 2021 at 12:52 PM Alexei Starovoitov via Libc-alpha wrote: > On Sat, Apr 24, 2021 at 10:56 AM Alejandro Colomar (man-pages) > wrote: > > > > Hello Alexei, > > > > On 4/24/21 1:20 AM, Alexei Starovoitov wrote: > > > Nack. > > > The man page should describe the kernel api the way it

Re: [RFC] bpf.2: Use standard types and attributes

2021-04-25 Thread Alexei Starovoitov via Gcc-patches
On Sat, Apr 24, 2021 at 10:56 AM Alejandro Colomar (man-pages) wrote: > > Hello Alexei, > > On 4/24/21 1:20 AM, Alexei Starovoitov wrote: > > Nack. > > The man page should describe the kernel api the way it is in .h file. > > Why? Because man page must describe the linux uapi headers the way

Re: [Patch, fortran] PR fortran/82376 - Duplicate function call using -fcheck=pointer

2021-04-25 Thread Paul Richard Thomas via Gcc-patches
Hi José! The fix is fine. Note however that the testcase will pass even without the fix because you haven't included the ! { dg-options "-fcheck=pointer" }. In fact, I suggest that you use the version of the tescase that I have attached that does not run but counts the number of occurrences of

Re: [PATCH 1/3] Come up with startswith function.

2021-04-25 Thread Arnaud Charlet
> Thank you for a quick reply. > There's an updated version of the patch. The Ada part is OK now, thanks.

Re: [PATCH] Fix logic error in 32-bit trampolines, PR target/98952

2021-04-25 Thread Bill Schmidt via Gcc-patches
On 4/23/21 6:58 PM, Segher Boessenkool wrote: On Fri, Apr 23, 2021 at 06:24:07PM -0400, Michael Meissner wrote: On Thu, Apr 22, 2021 at 05:56:32PM -0500, Segher Boessenkool wrote: As Will says, it looks like the ELFv2 version has the same bug. Please fix that the same way. Yes it has the

Re: [PATCH] [i386] Optimize __builtin_shuffle when it's used to zero the upper bits of the dest. [PR target/94680]

2021-04-25 Thread Hongtao Liu via Gcc-patches
On Fri, Apr 23, 2021 at 5:13 PM Jakub Jelinek wrote: > > On Fri, Apr 23, 2021 at 12:53:58PM +0800, Hongtao Liu via Gcc-patches wrote: > > + if (!CONST_INT_P (er)) > > + return 0; > > + ei = INTVAL (er); > > + if (i < nelt2 && ei != i) > > + return 0; > > + if (i >=