+2016-03-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/70272
+ * decl.c (begin_destructor_body): Don't insert clobber if
+ is_empty_class (current_class_type).
+
2016-03-17 Marek Polacek <polacek@redhat.com>
PR c++/70194
initialize_vtbl_ptrs (current_class_ptr);
finish_compound_stmt (compound_stmt);
- if (flag_lifetime_dse)
+ if (flag_lifetime_dse
+ /* Clobbering an empty base is harmful if it overlays real data. */
+ && !is_empty_class (current_class_type))
{
/* Insert a cleanup to let the back end know that the object is dead
when we exit the destructor, either normally or via exception. */
+2016-03-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/70272
+ * g++.dg/opt/flifetime-dse5.C (main): Remove extra semicolon.
+ * g++.dg/opt/flifetime-dse6.C: New test.
+ * g++.dg/tree-ssa/ehcleanup-1.C: Adjust unreachable count.
+
2016-03-17 H.J. Lu <hongjiu.lu@intel.com>
PR driver/70192
C c;
if ( c.a == false )
__builtin_abort();
-};
+}
--- /dev/null
+// PR c++/70272
+// { dg-options -O2 }
+// { dg-do run }
+
+struct Empty { };
+struct A { A() : a(true) { } bool a; ~A() { if (!a) __builtin_abort(); } };
+struct B : Empty { B() : Empty() { } ~B() { } };
+struct C : A, B { C() : A(), B() { } ~C() { } };
+int main() {
+ C c;
+}
// { dg-final { scan-tree-dump-times "Empty EH handler" 2 "ehcleanup1" } }
//
// And as a result also contained control flow.
-// { dg-final { scan-tree-dump-times "Removing unreachable" 6 "ehcleanup1" } }
+// { dg-final { scan-tree-dump-times "Removing unreachable" 4 "ehcleanup1" } }
//