]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR c++/66676 (pragma omp simd aligned(x) results in "internal compiler...
authorJakub Jelinek <jakub@redhat.com>
Fri, 30 Aug 2019 11:34:08 +0000 (13:34 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 30 Aug 2019 11:34:08 +0000 (13:34 +0200)
Backported from mainline
2019-01-29  Jakub Jelinek  <jakub@redhat.com>

PR c++/66676
PR ipa/89104
* omp-simd-clone.c (simd_clone_clauses_extract)
<case OMP_CLAUSE_ALIGNED>: Ignore clauses with NULL
OMP_CLAUSE_ALIGNED_ALIGNMENT.

* gcc.dg/gomp/pr89104.c: New test.

From-SVN: r275094

gcc/ChangeLog
gcc/omp-simd-clone.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/gomp/pr89104.c [new file with mode: 0644]

index a3bc11114a5733c7127798d529665861c5d65cc3..3747d5d57ea95b2a57938d2f170c678653edadbc 100644 (file)
@@ -1,6 +1,14 @@
 2019-08-30  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2019-01-29  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/66676
+       PR ipa/89104
+       * omp-simd-clone.c (simd_clone_clauses_extract)
+       <case OMP_CLAUSE_ALIGNED>: Ignore clauses with NULL
+       OMP_CLAUSE_ALIGNED_ALIGNMENT.
+
        2019-01-28  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/89002
index 9af80a45eb8f618528ef6ddc75dae9397f647f02..7815ce929ae511e5b7d7467053e54f7e98140a84 100644 (file)
@@ -240,6 +240,10 @@ simd_clone_clauses_extract (struct cgraph_node *node, tree clauses,
          }
        case OMP_CLAUSE_ALIGNED:
          {
+           /* Ignore aligned (x) for declare simd, for the ABI we really
+              need an alignment specified.  */
+           if (OMP_CLAUSE_ALIGNED_ALIGNMENT (t) == NULL_TREE)
+             break;
            tree decl = OMP_CLAUSE_DECL (t);
            int argno = tree_to_uhwi (decl);
            clone_info->args[argno].alignment
index c12d9ebf82a5b076c18261b6418d78a44a33caa9..d3d1d59c42cc1e3f2bc0fa3107f3406bb8200abf 100644 (file)
@@ -1,6 +1,12 @@
 2019-08-30  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2019-01-29  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/66676
+       PR ipa/89104
+       * gcc.dg/gomp/pr89104.c: New test.
+
        2019-01-27  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/87214
diff --git a/gcc/testsuite/gcc.dg/gomp/pr89104.c b/gcc/testsuite/gcc.dg/gomp/pr89104.c
new file mode 100644 (file)
index 0000000..505fdda
--- /dev/null
@@ -0,0 +1,11 @@
+/* PR c++/66676 */
+/* PR ipa/89104 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp-simd" } */
+
+#pragma omp declare simd uniform (x) aligned (x)
+int
+foo (int *x, int y)
+{
+  return x[y];
+}