aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Fortune <matthew.fortune@imgtec.com>2017-04-20 13:27:05 +0000
committerMatthew Fortune <matthew.fortune@imgtec.com>2017-04-20 13:27:05 +0000
commit44204acf245ddda46bf669b1049e8126a1c58441 (patch)
treebd92c04bcba3ededec979be27e466c102ad8ff71
parent2f467a54f8b729b2f9033de6a659fce7dd1c33a4 (diff)
MIPS: Prevent buffer overrun in uninitialised variable fix
gcc/ * config/mips/mips.c (mips_expand_vec_perm_const): Re-fix uninitialized variable warning to avoid buffer overrun. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@247022 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/mips/mips.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c908048f21b..80d343615b2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2017-04-20 Matthew Fortune <matthew.fortune@imgtec.com>
+
+ * config/mips/mips.c (mips_expand_vec_perm_const): Re-fix
+ uninitialized variable warning to avoid buffer overrun.
+
2017-04-20 Alexander Monakov <amonakov@ispras.ru>
PR other/71250
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index b35fba7e2ad..6bfd86a07af 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -21358,7 +21358,7 @@ mips_expand_vec_perm_const (rtx operands[4])
/* This is overly conservative, but ensures we don't get an
uninitialized warning on ORIG_PERM. */
- memset (&orig_perm[nelt], 0, MAX_VECT_LEN);
+ memset (orig_perm, 0, MAX_VECT_LEN);
for (i = which = 0; i < nelt; ++i)
{
rtx e = XVECEXP (sel, 0, i);