Commit 508d0c3d by Jakub Jelinek

re PR sanitizer/83987 (ICE with OpenMP, sanitizer and virtual bases)

	PR sanitizer/83987
	* tree.c (cp_free_lang_data): Change DECL_VALUE_EXPR of
	DECL_OMP_PRIVATIZED_MEMBER vars to error_mark_node.

	* g++.dg/ubsan/pr83987.C: New test.

From-SVN: r256997
parent 56dbd05b
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-23 Nathan Sidwell <nathan@acm.org> 2018-01-23 Nathan Sidwell <nathan@acm.org>
PR c++/83988 PR c++/83988
......
...@@ -5274,6 +5274,16 @@ cp_free_lang_data (tree t) ...@@ -5274,6 +5274,16 @@ cp_free_lang_data (tree t)
/* We do not need the leftover chaining of namespaces from the /* We do not need the leftover chaining of namespaces from the
binding level. */ binding level. */
DECL_CHAIN (t) = NULL_TREE; 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. /* Stub for c-common. Please keep in sync with c-decl.c.
......
2018-23-01 Paul Thomas <pault@gcc.gnu.org> 2018-01-23 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/83987
* g++.dg/ubsan/pr83987.C: New test.
2018-01-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83866 PR fortran/83866
* gfortran.dg/pdt_29.f03 : New test. * gfortran.dg/pdt_29.f03: New test.
2018-23-01 Paul Thomas <pault@gcc.gnu.org> 2018-01-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83898 PR fortran/83898
* gfortran.dg/associate_33.f03 : New test. * gfortran.dg/associate_33.f03: New test.
2018-01-23 Martin Liska <mliska@suse.cz> 2018-01-23 Martin Liska <mliska@suse.cz>
...@@ -1704,7 +1709,7 @@ ...@@ -1704,7 +1709,7 @@
2018-01-13 Paul Thomas <pault@gcc.gnu.org> 2018-01-13 Paul Thomas <pault@gcc.gnu.org>
PR fortran/52162 PR fortran/52162
* gfortran.dg/bounds_check_19.f90 : New test. * gfortran.dg/bounds_check_19.f90: New test.
2018-01-12 Jakub Jelinek <jakub@redhat.com> 2018-01-12 Jakub Jelinek <jakub@redhat.com>
...@@ -2262,12 +2267,12 @@ ...@@ -2262,12 +2267,12 @@
2018-01-08 Paul Thomas <pault@gcc.gnu.org> 2018-01-08 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83611 PR fortran/83611
* gfortran.dg/pdt_15.f03 : Bump count of 'n.data = 0B' to 8. * gfortran.dg/pdt_15.f03: Bump count of 'n.data = 0B' to 8.
* gfortran.dg/pdt_26.f03 : Bump count of '_malloc' to 9. * gfortran.dg/pdt_26.f03: Bump count of '_malloc' to 9.
* gfortran.dg/pdt_27.f03 : New test. * gfortran.dg/pdt_27.f03: New test.
PR fortran/83731 PR fortran/83731
* gfortran.dg/pdt_28.f03 : New test. * gfortran.dg/pdt_28.f03: New test.
2018-01-08 Tom de Vries <tom@codesourcery.com> 2018-01-08 Tom de Vries <tom@codesourcery.com>
...@@ -2562,10 +2567,10 @@ ...@@ -2562,10 +2567,10 @@
2018-01-01 Paul Thomas <pault@gcc.gnu.org> 2018-01-01 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83076 PR fortran/83076
* gfortran.dg/coarray_45.f90 : New test. * gfortran.dg/coarray_45.f90: New test.
PR fortran/83319 PR fortran/83319
* gfortran.dg/coarray_46.f90 : New test. * gfortran.dg/coarray_46.f90: New test.
2018-01-01 Jakub Jelinek <jakub@redhat.com> 2018-01-01 Jakub Jelinek <jakub@redhat.com>
......
// 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;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment