[arm] fix bootstrap failure due to uninitialized warning
diff mbox series

Message ID cb80fbbb-7398-b8ba-ca1e-ed4b943be781@arm.com
State New
Headers show
Series
  • [arm] fix bootstrap failure due to uninitialized warning
Related show

Commit Message

Richard Earnshaw (lists) Oct. 16, 2019, 4:46 p.m. UTC
The Arm port is failing bootstrap because GCC is now warning about an 
unitialized array.

The code is complex enough that I certainly can't be sure the compiler 
is wrong, so perhaps the best fix here is just to memset the entire 
array before use.

	* config/arm/arm.c (neon_valid_immediate): Clear bytes before use.

Applied to trunk.

Patch
diff mbox series

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 9f0975dc071..75a011029f1 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -12243,7 +12252,7 @@  neon_valid_immediate (rtx op, machine_mode mode, int inverse,
 
   unsigned int i, elsize = 0, idx = 0, n_elts;
   unsigned int innersize;
-  unsigned char bytes[16];
+  unsigned char bytes[16] = {};
   int immtype = -1, matches;
   unsigned int invmask = inverse ? 0xff : 0;
   bool vector = GET_CODE (op) == CONST_VECTOR;