Re: [PATCH] avoid folding of invalid indices to compound literals (PR 92341)

2019-11-04 Thread Jeff Law
On 11/4/19 3:05 PM, Martin Sebor wrote: > While testing some other changes I noticed that -Warray-bounds > fails to detect out-of-bounds indices to compound literals such > as in: > >   int *p = (int[]){ 1, 2, 3 }; >   // ... >   p[3] = 7; > > This is because SRA transforms such references into a

[PATCH] avoid folding of invalid indices to compound literals (PR 92341)

2019-11-04 Thread Martin Sebor
While testing some other changes I noticed that -Warray-bounds fails to detect out-of-bounds indices to compound literals such as in: int *p = (int[]){ 1, 2, 3 }; // ... p[3] = 7; This is because SRA transforms such references into accesses to uninitialized scalar variables and also sets t