]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[arm] fix bootstrap failure due to uninitialized warning
authorrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 16 Oct 2019 16:44:34 +0000 (16:44 +0000)
committerrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 16 Oct 2019 16:44:34 +0000 (16:44 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@277073 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/arm/arm.c

index 11d3f13a5135e727a5fd4f7609bc87e248b3f3a4..5662f9ffea90c8a7feaf55554f13ba76b8946035 100644 (file)
@@ -1,3 +1,7 @@
+2019-10-16  Richard Earnshaw  <rearnsha@arm.com>
+
+       * config/arm/arm.c (neon_valid_immediate): Clear bytes before use.
+
 2019-10-16  Mihailo Stojanovic  <mistojanovic@wavecomp.com>
 
        * config/mips/mips.c (mips_expand_builtin_insn): Force the
index ba33047014113949162d0c8de6f0b4571304cf7a..3bf8cd637596e543467e901172bc70d0d0092803 100644 (file)
@@ -12233,7 +12233,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;