On 10/14/20 2:55 PM, Martin Sebor wrote: > The new gimple_parm_array_size() function computes the size > of an array function parameter implied by its upper bound. > The code that does this strips one too many layers of array > types from the parameter, returning a smaller size than > implied by the second most significant bound. (I must have > copied the code from somewhere else and not tested it very > well.) > > The attached fix removes the additional peeling. I'll commit > this obvious patch shortly. > > Martin > > PS The test exposes two minor bugs/limitations in the warning. > One is xfailed in the test itself and the other is pr97425. > > gcc-97391.diff > > PR middle-end/97391 - bogus -Warray-bounds accessing a multidimensional array > parameter > > PR middle-end/97391 > * builtins.c (gimple_parm_array_size): Peel off one less layer > of array types. > > gcc/testsuite/ChangeLog: > > PR middle-end/97391 > * gcc.dg/Warray-bounds-68.c: New test.
OK jeff