On Sat, 2020-06-06 at 14:30 -0600, Martin Sebor via Gcc-patches wrote:
> A recent enhancement to the uninitialized access coverage to include
> dynamically allocated objects, including alloca and VLAs, triggers
> an expected instance of -Wmaybe-uninitialized on powerpc64-linux
> in reload_cse_simplify_operands where an element of an XALLOCAVEC-
> allocated array is read before it's provably assigned to.  With
> -Werror this causes the bootstrap there to fail.
> 
> The attached patch avoids the warning by clearing the element first.
> 
> Although not necessary to avoid the warning, the patch also adds
> an assert to verify that the array isn't accessed outside its bounds.
> recog.c sets which_alternative to -1 in a couple of places and
> a number of tests for it being equal to it so I added the assert
> "just to be sure."
> 
> Tested on x86_64-linux (the warning was also confirmed gone on
> powerpc64 by the reporter).
> 
> Martin

> PR bootstrap/95555 - powepc64 bootstrap failure due to -Wmaybe-uninitialized 
> in reload_cse_simplify_operands
> 
> gcc/ChangeLog:
> 
>       * postreload.c (reload_cse_simplify_operands): Clear first array element
>       before using it.  Assert a precondition.
OK
jeff

Reply via email to