]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR c++/59627 (ICE with OpenMP "declare reduction" and -flto)
authorJakub Jelinek <jakub@redhat.com>
Thu, 11 Feb 2016 09:28:23 +0000 (10:28 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 11 Feb 2016 09:28:23 +0000 (10:28 +0100)
Backported from mainline
2016-02-08  Jakub Jelinek  <jakub@redhat.com>

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: r233336

gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/gomp/pr59627.C [new file with mode: 0644]

index 2afcffa807eb1b73e978ba5192a3fccd0c109c1e..02776465da7449b989737bd1f3aa9b08e84ef0a2 100644 (file)
@@ -1,3 +1,12 @@
+2016-02-11  Jakub Jelinek  <jakub@redhat.com>
+
+       Backported from mainline
+       2016-02-08  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/59627
+       * parser.c (cp_parser_omp_declare_reduction): Set assembler name
+       of the DECL_OMP_DECLARE_REDUCTION_P decls.
+
 2016-02-10  Jason Merrill  <jason@redhat.com>
 
        PR c++/68926
index 18c706846bacec72eff659266d372b9e09640994..c811c482725d48043c38a3082fb96043fafdcab5 100644 (file)
@@ -30918,6 +30918,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 ("<udr>"));
       DECL_ATTRIBUTES (fndecl)
        = tree_cons (get_identifier ("gnu_inline"), NULL_TREE,
                     DECL_ATTRIBUTES (fndecl));
index 65e4b56d50869ca28effdaae9dd90539d8b50606..3eba02f66890a8edcab533a15b173a029287aa05 100644 (file)
@@ -1,6 +1,11 @@
 2016-02-11  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2016-02-08  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/59627
+       * g++.dg/gomp/pr59627.C: New test.
+
        2016-01-22  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/69432
diff --git a/gcc/testsuite/g++.dg/gomp/pr59627.C b/gcc/testsuite/g++.dg/gomp/pr59627.C
new file mode 100644 (file)
index 0000000..ab6f44d
--- /dev/null
@@ -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)
+  ;
+}