Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-15 Thread Qing Zhao via Gcc-patches
> On Jul 15, 2021, at 9:16 AM, Qing Zhao via Gcc-patches > wrote: > >> Note that I think .DEFERRED_INIT can be elided for variables that do not have their address taken - otherwise we'll also have to worry about aggregate copy initialization and SRA decomposing

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-15 Thread Qing Zhao via Gcc-patches
Hi, Richard, > On Jul 15, 2021, at 2:56 AM, Richard Biener > wrote: > >>> On Wed, Jul 14, 2021 at 1:17 AM Qing Zhao wrote: Hi, Kees, I took a look at the kernel testing case you attached in the previous email, and found the testing failed with the following case:

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-15 Thread Richard Biener via Gcc-patches
On Wed, Jul 14, 2021 at 4:10 PM Qing Zhao wrote: > > Hi, Richard, > > > On Jul 14, 2021, at 2:14 AM, Richard Biener > > wrote: > > > > On Wed, Jul 14, 2021 at 1:17 AM Qing Zhao wrote: > >> > >> Hi, Kees, > >> > >> I took a look at the kernel testing case you attached in the previous > >>

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-14 Thread Qing Zhao via Gcc-patches
> On Jul 14, 2021, at 4:23 PM, Kees Cook wrote: > > On Wed, Jul 14, 2021 at 07:30:45PM +, Qing Zhao wrote: >> Hi, Kees, >> >> >>> On Jul 14, 2021, at 2:11 PM, Kees Cook wrote: >>> >>> On Wed, Jul 14, 2021 at 02:09:50PM +, Qing Zhao wrote: Hi, Richard, > On Jul 14,

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-14 Thread Kees Cook via Gcc-patches
On Wed, Jul 14, 2021 at 07:30:45PM +, Qing Zhao wrote: > Hi, Kees, > > > > On Jul 14, 2021, at 2:11 PM, Kees Cook wrote: > > > > On Wed, Jul 14, 2021 at 02:09:50PM +, Qing Zhao wrote: > >> Hi, Richard, > >> > >>> On Jul 14, 2021, at 2:14 AM, Richard Biener > >>> wrote: > >>> > >>>

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-14 Thread Qing Zhao via Gcc-patches
Hi, Kees, > On Jul 14, 2021, at 2:11 PM, Kees Cook wrote: > > On Wed, Jul 14, 2021 at 02:09:50PM +, Qing Zhao wrote: >> Hi, Richard, >> >>> On Jul 14, 2021, at 2:14 AM, Richard Biener >>> wrote: >>> >>> On Wed, Jul 14, 2021 at 1:17 AM Qing Zhao wrote: Hi, Kees, I

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-14 Thread Kees Cook via Gcc-patches
On Wed, Jul 14, 2021 at 02:09:50PM +, Qing Zhao wrote: > Hi, Richard, > > > On Jul 14, 2021, at 2:14 AM, Richard Biener > > wrote: > > > > On Wed, Jul 14, 2021 at 1:17 AM Qing Zhao wrote: > >> > >> Hi, Kees, > >> > >> I took a look at the kernel testing case you attached in the previous

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-14 Thread Qing Zhao via Gcc-patches
Hi, Richard, > On Jul 14, 2021, at 2:14 AM, Richard Biener > wrote: > > On Wed, Jul 14, 2021 at 1:17 AM Qing Zhao wrote: >> >> Hi, Kees, >> >> I took a look at the kernel testing case you attached in the previous email, >> and found the testing failed with the following case: >> >>

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-14 Thread Richard Biener via Gcc-patches
On Wed, Jul 14, 2021 at 1:17 AM Qing Zhao wrote: > > Hi, Kees, > > I took a look at the kernel testing case you attached in the previous email, > and found the testing failed with the following case: > > #define INIT_STRUCT_static_all = { .one = arg->one,\ >

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-13 Thread Kees Cook via Gcc-patches
On Tue, Jul 13, 2021 at 11:16:59PM +, Qing Zhao wrote: > Hi, Kees, > > I took a look at the kernel testing case you attached in the previous email, > and found the testing failed with the following case: > > #define INIT_STRUCT_static_all = { .one = arg->one,\ >

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-13 Thread Qing Zhao via Gcc-patches
Hi, Kees, I took a look at the kernel testing case you attached in the previous email, and found the testing failed with the following case: #define INIT_STRUCT_static_all = { .one = arg->one,\ .two = arg->two,\

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-13 Thread Kees Cook via Gcc-patches
On Tue, Jul 13, 2021 at 02:29:33PM -0700, Kees Cook wrote: > I've extracted the kernel test to build for userspace, and it behaves > the same way. See attached "stackinit.c". I've adjusted this slightly (the "static" tests weren't testing the correct thing, but the results remained the same).

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-13 Thread Kees Cook via Gcc-patches
On Mon, Jul 12, 2021 at 08:28:55PM +, Qing Zhao wrote: > > On Jul 12, 2021, at 12:56 PM, Kees Cook wrote: > > On Wed, Jul 07, 2021 at 05:38:02PM +, Qing Zhao wrote: > >> This is the 4th version of the patch for the new security feature for GCC. > > > > It looks like padding

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-12 Thread Qing Zhao via Gcc-patches
Hi, Kees, Thanks a lot for your testing on kernel testing cases. I have some question in below: > On Jul 12, 2021, at 12:56 PM, Kees Cook wrote: > > On Wed, Jul 07, 2021 at 05:38:02PM +, Qing Zhao wrote: >> Hi, >> >> This is the 4th version of the patch for the new security feature for

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-12 Thread Qing Zhao via Gcc-patches
Hi, Martin, Thanks a lot for your experiments and examples, they are really helpful. So, based on your study, I will delete the code that handle grp_to_be_debug_replaced accesses in generate_subtree_deferred_init. Let me know if you have further comments on this. Qing > On Jul 12, 2021, at

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-12 Thread Kees Cook via Gcc-patches
On Wed, Jul 07, 2021 at 05:38:02PM +, Qing Zhao wrote: > Hi, > > This is the 4th version of the patch for the new security feature for GCC. > > I have tested it with bootstrap on both x86 and aarch64, regression testing > on both x86 and aarch64. > Also compile and run CPU2017, without any

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-12 Thread Martin Jambor
Hi, On Mon, Jul 12 2021, Qing Zhao wrote: >> On Jul 12, 2021, at 2:51 AM, Richard Sandiford >> wrote: >> >> Martin Jambor writes: >>> On Thu, Jul 08 2021, Qing Zhao wrote: (Resend this email since the previous one didn’t quote, I changed one setting in my mail client, hopefully that

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-12 Thread Qing Zhao via Gcc-patches
> On Jul 12, 2021, at 2:51 AM, Richard Sandiford > wrote: > > Martin Jambor writes: >> On Thu, Jul 08 2021, Qing Zhao wrote: >>> (Resend this email since the previous one didn’t quote, I changed one >>> setting in my mail client, hopefully that can fix this issue). >>> >>> Hi, Martin, >>>

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-12 Thread Richard Sandiford via Gcc-patches
Martin Jambor writes: > On Thu, Jul 08 2021, Qing Zhao wrote: >> (Resend this email since the previous one didn’t quote, I changed one >> setting in my mail client, hopefully that can fix this issue). >> >> Hi, Martin, >> >> Thank you for the review and comment. >> >>> On Jul 8, 2021, at 8:29 AM,

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-09 Thread Qing Zhao via Gcc-patches
Hi, > On Jul 9, 2021, at 11:18 AM, Martin Jambor wrote: >> >>> On Jul 8, 2021, at 8:29 AM, Martin Jambor wrote: diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index c05d22f3e8f1..35051d7c6b96 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -384,6 +384,13 @@ static

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-09 Thread Martin Jambor
Hi, On Thu, Jul 08 2021, Qing Zhao wrote: > (Resend this email since the previous one didn’t quote, I changed one > setting in my mail client, hopefully that can fix this issue). > > Hi, Martin, > > Thank you for the review and comment. > >> On Jul 8, 2021, at 8:29 AM, Martin Jambor wrote: >>>

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-08 Thread Qing Zhao via Gcc-patches
(Resend this email since the previous one didn’t quote, I changed one setting in my mail client, hopefully that can fix this issue). Hi, Martin, Thank you for the review and comment. > On Jul 8, 2021, at 8:29 AM, Martin Jambor wrote: >> diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c >> index

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-08 Thread Qing Zhao via Gcc-patches
Hi, Martin, Thank you for the review and comment. On Jul 8, 2021, at 8:29 AM, Martin Jambor mailto:mjam...@suse.cz>> wrote: diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index c05d22f3e8f1..35051d7c6b96 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -384,6 +384,13 @@ static struct /*

Re: [patch][version 4]add -ftrivial-auto-var-init and variable attribute "uninitialized" to gcc

2021-07-08 Thread Martin Jambor
Hi, On Wed, Jul 07 2021, Qing Zhao via Gcc-patches wrote: > Hi, > > This is the 4th version of the patch for the new security feature for GCC. I have been following the threads about this feature only very lightly, so please accept my apologies if my comments are about something which has been