re PR tree-optimization/56635 (internal compiler error: in find_lattice_value, at tree-complex.c:15)

PR tree-optimization/56635
	* fold-const.c (operand_equal_p): For MEM_REF and TARGET_MEM_REF,
	require types_compatible_p types.

	* g++.dg/torture/pr56635.C: New test.

From-SVN: r196781
This commit is contained in:
Jakub Jelinek 2013-03-18 14:01:49 +01:00 committed by Jakub Jelinek
parent a6178a256d
commit 38c56a5b21
4 changed files with 31 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2013-03-18 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/56635
* fold-const.c (operand_equal_p): For MEM_REF and TARGET_MEM_REF,
require types_compatible_p types.
2013-03-18 Nick Clifton <nickc@redhat.com>
* config/stormy16/stormy16.c (xstormy16_expand_prologue): Remove

View File

@ -2572,13 +2572,14 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
flags &= ~OEP_CONSTANT_ADDRESS_OF;
/* Require equal access sizes, and similar pointer types.
We can have incomplete types for array references of
variable-sized arrays from the Fortran frontent
though. */
variable-sized arrays from the Fortran frontend
though. Also verify the types are compatible. */
return ((TYPE_SIZE (TREE_TYPE (arg0)) == TYPE_SIZE (TREE_TYPE (arg1))
|| (TYPE_SIZE (TREE_TYPE (arg0))
&& TYPE_SIZE (TREE_TYPE (arg1))
&& operand_equal_p (TYPE_SIZE (TREE_TYPE (arg0)),
TYPE_SIZE (TREE_TYPE (arg1)), flags)))
&& types_compatible_p (TREE_TYPE (arg0), TREE_TYPE (arg1))
&& (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (arg0, 1)))
== TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (arg1, 1))))
&& OP_SAME (0) && OP_SAME (1));

View File

@ -1,3 +1,8 @@
2013-03-18 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/56635
* g++.dg/torture/pr56635.C: New test.
2013-03-18 Richard Biener <rguenther@suse.de>
PR tree-optimization/3713

View File

@ -0,0 +1,17 @@
// PR tree-optimization/56635
// { dg-do compile }
struct A { _Complex double a; };
void
foo (A **x, A **y)
{
A r;
if (__real__ x[0]->a)
{
r.a = y[0]->a / x[0]->a;
**x = r;
}
else
**x = **y;
}