+2019-07-25 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/91236
+ * tree-ssa-sccvn.c (vn_walk_cb_data::push_partial_def): Fix
+ size of CONSTRUCTOR write. Fix buffer size we pass to
+ native_encode_expr.
+
2019-07-24 Jozef Lawrynowicz <jozef.l@mittosystems.com>
* config.gcc (msp430*-*-*): Fix non-GNU style in r273774.
if (TREE_CODE (pd.rhs) == CONSTRUCTOR)
/* Empty CONSTRUCTOR. */
memset (buffer + MAX (0, pd.offset),
- 0, MIN ((HOST_WIDE_INT)sizeof (buffer),
+ 0, MIN ((HOST_WIDE_INT)sizeof (buffer) - MAX (0, pd.offset),
pd.size + MIN (0, pd.offset)));
else
{
pad = GET_MODE_SIZE (mode) - pd.size;
}
len = native_encode_expr (pd.rhs, buffer + MAX (0, pd.offset),
- sizeof (buffer - MAX (0, pd.offset)),
+ sizeof (buffer) - MAX (0, pd.offset),
MAX (0, -pd.offset) + pad);
if (len <= 0 || len < (pd.size - MAX (0, -pd.offset)))
{