+2015-12-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/68785
+ * gimple-fold.c (fold_ctor_reference): Pass return value from
+ native_encode_expr to native_interpret_expr.
+ * tree-ssa-sccvn.c (fully_constant_vn_reference_p): Likewise.
+
2015-12-10 Richard Biener <rguenther@suse.de>
PR ipa/68331
&& size <= MAX_BITSIZE_MODE_ANY_MODE)
{
unsigned char buf[MAX_BITSIZE_MODE_ANY_MODE / BITS_PER_UNIT];
- if (native_encode_expr (ctor, buf, size / BITS_PER_UNIT,
- offset / BITS_PER_UNIT) > 0)
- return native_interpret_expr (type, buf, size / BITS_PER_UNIT);
+ int len = native_encode_expr (ctor, buf, size / BITS_PER_UNIT,
+ offset / BITS_PER_UNIT);
+ if (len > 0)
+ return native_interpret_expr (type, buf, len);
}
if (TREE_CODE (ctor) == CONSTRUCTOR)
{
+2015-12-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/68785
+ * gcc.dg/pr68785.c: New test.
+
2015-12-10 Richard Biener <rguenther@suse.de>
PR ipa/68331
--- /dev/null
+/* PR tree-optimization/68785 */
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+int
+foo (void)
+{
+ return *(int *) "";
+}
else
{
unsigned char buf[MAX_BITSIZE_MODE_ANY_MODE / BITS_PER_UNIT];
- if (native_encode_expr (ctor, buf, size, off) > 0)
- return native_interpret_expr (ref->type, buf, size);
+ int len = native_encode_expr (ctor, buf, size, off);
+ if (len > 0)
+ return native_interpret_expr (ref->type, buf, len);
}
}
}