diff options
-rw-r--r-- | gcc/cgraph.cc | 1 | ||||
-rw-r--r-- | gcc/cgraphclones.cc | 1 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/opt/pr105306.C | 13 |
3 files changed, 15 insertions, 0 deletions
diff --git a/gcc/cgraph.cc b/gcc/cgraph.cc index b923a59..d3cc06b 100644 --- a/gcc/cgraph.cc +++ b/gcc/cgraph.cc @@ -507,6 +507,7 @@ cgraph_node::create (tree decl) gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); node->decl = decl; + node->semantic_interposition = opt_for_fn (decl, flag_semantic_interposition); if ((flag_openacc || flag_openmp) && lookup_attribute ("omp declare target", DECL_ATTRIBUTES (decl))) diff --git a/gcc/cgraphclones.cc b/gcc/cgraphclones.cc index 60da1e8..eb0fa87 100644 --- a/gcc/cgraphclones.cc +++ b/gcc/cgraphclones.cc @@ -394,6 +394,7 @@ cgraph_node::create_clone (tree new_decl, profile_count prof_count, new_node->versionable = versionable; new_node->can_change_signature = can_change_signature; new_node->redefined_extern_inline = redefined_extern_inline; + new_node->semantic_interposition = semantic_interposition; new_node->tm_may_enter_irr = tm_may_enter_irr; new_node->externally_visible = false; new_node->no_reorder = no_reorder; diff --git a/gcc/testsuite/g++.dg/opt/pr105306.C b/gcc/testsuite/g++.dg/opt/pr105306.C new file mode 100644 index 0000000..552d374 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr105306.C @@ -0,0 +1,13 @@ +// PR ipa/105306 +// { dg-do compile } +// { dg-options "-Ofast" } + +#pragma GCC optimize 0 +template <typename T> void foo (T); +struct B { ~B () {} }; +struct C { B f; }; +template <typename> struct E { + void bar () { foo (g); } + C g; +}; +template class E<char>; |