From 798d7f42dc0c713abcf6b58ed9f1ff4e36391442 Mon Sep 17 00:00:00 2001 From: Matthew Fortune Date: Thu, 20 Apr 2017 13:27:05 +0000 Subject: [PATCH] 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. From-SVN: r247022 --- gcc/ChangeLog | 5 +++++ gcc/config/mips/mips.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c908048..80d3436 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-04-20 Matthew Fortune + + * config/mips/mips.c (mips_expand_vec_perm_const): Re-fix + uninitialized variable warning to avoid buffer overrun. + 2017-04-20 Alexander Monakov PR other/71250 diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index b35fba7..6bfd86a 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); -- 2.7.4