From: Jakub Jelinek Date: Mon, 8 Feb 2016 18:23:03 +0000 (+0100) Subject: re PR c++/59627 (ICE with OpenMP "declare reduction" and -flto) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f68bc23fdd160514737ddbc420ec7b3de7358286;p=gcc.git re PR c++/59627 (ICE with OpenMP "declare reduction" and -flto) 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. From-SVN: r233225 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 32fbe6f6163..f7a76ffab0e 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 d03b0c9596d..b7bfa773bad 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 c28912668c9..64f512d4496 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 00000000000..ab6f44df116 --- /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) + ; +}