aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/vec.h14
2 files changed, 10 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4574360..0b3c84f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2016-12-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR bootstrap/78817
+ * vec.h (vec<T, va_heap, vl_ptr>::safe_grow_cleared): Revert
+ 2016-12-15 change.
+
2016-12-21 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/78580
diff --git a/gcc/vec.h b/gcc/vec.h
index 3877f2d..aa93411 100644
--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -1607,16 +1607,10 @@ inline void
vec<T, va_heap, vl_ptr>::safe_grow_cleared (unsigned len MEM_STAT_DECL)
{
unsigned oldlen = length ();
- gcc_checking_assert (oldlen <= len);
-
- if (size_t sz = sizeof (T) * (len - oldlen))
- {
- safe_grow (len PASS_MEM_STAT);
-
- T *p = address ();
- gcc_assert (p != NULL);
- memset (p + oldlen, 0, sz);
- }
+ size_t sz = sizeof (T) * (len - oldlen);
+ safe_grow (len PASS_MEM_STAT);
+ if (sz != 0)
+ memset (&(address ()[oldlen]), 0, sz);
}