+2016-06-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/71405
+ * tree-ssa.c (execute_update_addresses_taken): For clobber with
+ incompatible type, build a new clobber with the right type instead
+ of building a VIEW_CONVERT_EXPR around it.
+
2016-06-04 Oleg Endo <olegendo@gcc.gnu.org>
PR tree-optimization/52171
+2016-06-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/71405
+ * g++.dg/torture/pr71405.C: New test.
+
2016-06-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/70202
--- /dev/null
+// PR tree-optimization/71405
+// { dg-do compile }
+
+struct C
+{
+ C () {}
+ int i;
+};
+
+void *
+operator new (__SIZE_TYPE__ x, void *y)
+{
+ return y;
+}
+
+int
+main ()
+{
+ int a;
+ new (&a) C;
+ return a;
+}
if (gimple_assign_lhs (stmt) != lhs
&& !useless_type_conversion_p (TREE_TYPE (lhs),
TREE_TYPE (rhs)))
- rhs = fold_build1 (VIEW_CONVERT_EXPR,
- TREE_TYPE (lhs), rhs);
-
+ {
+ if (gimple_clobber_p (stmt))
+ {
+ rhs = build_constructor (TREE_TYPE (lhs), NULL);
+ TREE_THIS_VOLATILE (rhs) = 1;
+ }
+ else
+ rhs = fold_build1 (VIEW_CONVERT_EXPR,
+ TREE_TYPE (lhs), rhs);
+ }
if (gimple_assign_lhs (stmt) != lhs)
gimple_assign_set_lhs (stmt, lhs);