+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
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));
+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
--- /dev/null
+// 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;
+}