2018-06-25 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2018-01-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/83987
+ * tree.c (cp_free_lang_data): Change DECL_VALUE_EXPR of
+ DECL_OMP_PRIVATIZED_MEMBER vars to error_mark_node.
+
2018-01-18 Jakub Jelinek <jakub@redhat.com>
PR c++/83824
from the binding level. */
DECL_CHAIN (t) = NULL_TREE;
}
+ /* Set DECL_VALUE_EXPRs of OpenMP privatized member artificial
+ decls to error_mark_node. These are DECL_IGNORED_P and after
+ OpenMP lowering they aren't useful anymore. Clearing DECL_VALUE_EXPR
+ doesn't work, as expansion could then consider them as something
+ to be expanded. */
+ if (VAR_P (t)
+ && DECL_LANG_SPECIFIC (t)
+ && DECL_OMP_PRIVATIZED_MEMBER (t)
+ && DECL_IGNORED_P (t))
+ SET_DECL_VALUE_EXPR (t, error_mark_node);
}
/* Stub for c-common. Please keep in sync with c-decl.c.
2018-06-25 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2018-01-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/83987
+ * g++.dg/ubsan/pr83987.C: New test.
+
2018-01-20 Jakub Jelinek <jakub@redhat.com>
PR target/83930
--- /dev/null
+// PR sanitizer/83987
+// { dg-do compile { target fopenmp } }
+// { dg-options "-fopenmp -fsanitize=vptr -O0" }
+
+struct A { int i; };
+struct B : virtual A { void foo (); };
+
+void
+B::foo ()
+{
+#pragma omp sections lastprivate (i)
+ {
+ i = 0;
+ }
+}