From: jakub Date: Mon, 8 Feb 2016 18:23:03 +0000 (+0000) Subject: PR c++/59627 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0acb2d6e11a65c6450c02c33a08ca2926484c689;p=thirdparty%2Fgcc.git PR c++/59627 * parser.c (cp_parser_omp_declare_reduction): Set assembler name of the DECL_OMP_DECLARE_REDUCTION_P decls. * g++.dg/gomp/pr59627.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233225 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 32fbe6f6163a..f7a76ffab0ec 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2016-02-08 Jakub Jelinek + + PR c++/59627 + * parser.c (cp_parser_omp_declare_reduction): Set assembler name + of the DECL_OMP_DECLARE_REDUCTION_P decls. + 2016-02-08 Marek Polacek PR c++/69688 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index d03b0c9596d0..b7bfa773bad3 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -36080,6 +36080,7 @@ cp_parser_omp_declare_reduction (cp_parser *parser, cp_token *pragma_tok, DECL_DECLARED_INLINE_P (fndecl) = 1; DECL_IGNORED_P (fndecl) = 1; DECL_OMP_DECLARE_REDUCTION_P (fndecl) = 1; + SET_DECL_ASSEMBLER_NAME (fndecl, get_identifier ("")); DECL_ATTRIBUTES (fndecl) = tree_cons (get_identifier ("gnu_inline"), NULL_TREE, DECL_ATTRIBUTES (fndecl)); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c28912668c9b..64f512d44967 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2016-02-08 Jakub Jelinek + PR c++/59627 + * g++.dg/gomp/pr59627.C: New test. + PR ipa/69239 * g++.dg/ipa/pr69239.C: New test. diff --git a/gcc/testsuite/g++.dg/gomp/pr59627.C b/gcc/testsuite/g++.dg/gomp/pr59627.C new file mode 100644 index 000000000000..ab6f44df116b --- /dev/null +++ b/gcc/testsuite/g++.dg/gomp/pr59627.C @@ -0,0 +1,14 @@ +// PR c++/59627 +// { dg-do compile { target lto } } +// { dg-options "-fopenmp -flto" } + +struct A { A () : i (0) {} int i; }; + +void +foo () +{ + A a; + #pragma omp declare reduction (+: A: omp_out.i += omp_in.i) + #pragma omp parallel reduction (+: a) + ; +}