+2016-12-01 Richard Biener <rguenther@suse.de>
+ Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
+
+ * vec.h (vec<T, A, vl_embed>::quick_grow_cleared): Guard call to
+ memset if len-oldlen != 0.
+ (vec<T, va_heap, vl_ptr>::safe_grow_cleared): Likewise.
+
2016-12-01 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (*andndi3_doubleword): Depend on TARGET_SSE2.
vec<T, A, vl_embed>::quick_grow_cleared (unsigned len)
{
unsigned oldlen = length ();
+ size_t sz = sizeof (T) * (len - oldlen);
quick_grow (len);
- memset (&(address ()[oldlen]), 0, sizeof (T) * (len - oldlen));
+ if (sz != 0)
+ memset (&(address ()[oldlen]), 0, sz);
}
vec<T, va_heap, vl_ptr>::safe_grow_cleared (unsigned len MEM_STAT_DECL)
{
unsigned oldlen = length ();
+ size_t sz = sizeof (T) * (len - oldlen);
safe_grow (len PASS_MEM_STAT);
- memset (&(address ()[oldlen]), 0, sizeof (T) * (len - oldlen));
+ if (sz != 0)
+ memset (&(address ()[oldlen]), 0, sz);
}