+2018-08-02 Richard Biener <rguenther@suse.de>
+
+ PR c++/86763
+ * class.c (layout_class_type): Copy TYPE_TYPELESS_STORAGE
+ to the CLASSTYPE_AS_BASE.
+
2018-08-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/86816
bitsize_int (BITS_PER_UNIT)));
SET_TYPE_ALIGN (base_t, rli->record_align);
TYPE_USER_ALIGN (base_t) = TYPE_USER_ALIGN (t);
+ TYPE_TYPELESS_STORAGE (base_t) = TYPE_TYPELESS_STORAGE (t);
/* Copy the non-static data members of T. This will include its
direct non-virtual bases & vtable. */
+2018-08-02 Richard Biener <rguenther@suse.de>
+
+ PR c++/86763
+ * g++.dg/torture/pr86763.C: New testcase.
+
2018-08-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/86816
--- /dev/null
+// { dg-do run }
+// { dg-additional-options "-fschedule-insns2 -fstrict-aliasing" }
+
+#include <cstdint>
+#include <cassert>
+#include <time.h>
+struct ID {
+ uint64_t value;
+};
+uint64_t value(ID id) { return id.value; }
+uint64_t gen { 1000 };
+struct Msg {
+ uint64_t time;
+ ID id;
+};
+struct V {
+ V() { }
+ V(Msg const & msg) : msg(msg) { }
+ Msg & get() { return msg; }
+ Msg msg;
+ char pad[237 - sizeof(Msg)];
+};
+struct T : V { using V::V; };
+Msg init_msg() {
+ Msg msg;
+ timespec t;
+ clock_gettime(CLOCK_REALTIME, &t);
+ msg.time = t.tv_sec + t.tv_nsec;
+ msg.id.value = ++gen;
+ return msg;
+}
+int main() {
+ T t;
+ t = init_msg();
+ assert(value(t.get().id) == 1001);
+}