Commit 1ff0a84c by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/68785 (valgrind reports issues with folding on x86_64)

	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.

	* gcc.dg/pr68785.c: New test.

From-SVN: r231499
parent ee7d29b4
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> 2015-12-10 Richard Biener <rguenther@suse.de>
PR ipa/68331 PR ipa/68331
...@@ -5495,9 +5495,10 @@ fold_ctor_reference (tree type, tree ctor, unsigned HOST_WIDE_INT offset, ...@@ -5495,9 +5495,10 @@ fold_ctor_reference (tree type, tree ctor, unsigned HOST_WIDE_INT offset,
&& size <= MAX_BITSIZE_MODE_ANY_MODE) && size <= MAX_BITSIZE_MODE_ANY_MODE)
{ {
unsigned char buf[MAX_BITSIZE_MODE_ANY_MODE / BITS_PER_UNIT]; unsigned char buf[MAX_BITSIZE_MODE_ANY_MODE / BITS_PER_UNIT];
if (native_encode_expr (ctor, buf, size / BITS_PER_UNIT, int len = native_encode_expr (ctor, buf, size / BITS_PER_UNIT,
offset / BITS_PER_UNIT) > 0) offset / BITS_PER_UNIT);
return native_interpret_expr (type, buf, size / BITS_PER_UNIT); if (len > 0)
return native_interpret_expr (type, buf, len);
} }
if (TREE_CODE (ctor) == CONSTRUCTOR) 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> 2015-12-10 Richard Biener <rguenther@suse.de>
PR ipa/68331 PR ipa/68331
......
/* PR tree-optimization/68785 */
/* { dg-do compile } */
/* { dg-options "-O3" } */
int
foo (void)
{
return *(int *) "";
}
...@@ -1370,8 +1370,9 @@ fully_constant_vn_reference_p (vn_reference_t ref) ...@@ -1370,8 +1370,9 @@ fully_constant_vn_reference_p (vn_reference_t ref)
else else
{ {
unsigned char buf[MAX_BITSIZE_MODE_ANY_MODE / BITS_PER_UNIT]; unsigned char buf[MAX_BITSIZE_MODE_ANY_MODE / BITS_PER_UNIT];
if (native_encode_expr (ctor, buf, size, off) > 0) int len = native_encode_expr (ctor, buf, size, off);
return native_interpret_expr (ref->type, buf, size); if (len > 0)
return native_interpret_expr (ref->type, buf, len);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment