PR c++/11266
* gimplify.c (gimple_add_tmp_var): Also make sure
seen_in_bind_expr isn't set.
(mostly_copy_tree_r): Don't copy a TARGET_EXPR.
(gimplify_target_expr): Only expand a TARGET_EXPR the first time
we see it.
[[Split portion of a mixed commit.]]
From-SVN: r73674.2
--- /dev/null
+// PR c++/11266
+// We were expanding the same TARGET_EXPR twice, for placement new and
+// delete.
+
+void* operator new (unsigned int, void*) throw();
+void operator delete (void*, void*) throw();
+
+struct A { A(); };
+
+void foo() { new(new A)A; }