]> gcc.gnu.org Git - gcc.git/commitdiff
backport: re PR c++/66676 (pragma omp simd aligned(x) results in "internal compiler...
authorJakub Jelinek <jakub@redhat.com>
Thu, 7 Feb 2019 14:45:41 +0000 (15:45 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 7 Feb 2019 14:45:41 +0000 (15:45 +0100)
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: r268636

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

index cb9a7ce915e18edd8fd841492a67e7c91dc878a0..f5805f670a28dbd1e27de56e6078883acdcdb08a 100644 (file)
@@ -1,6 +1,14 @@
 2019-02-07  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 292ff37a210a67f5d37cab8cf6b81cd248a89997..8b4cd9cb72ff8c7dfb98aa36255463dded0effad 100644 (file)
@@ -242,6 +242,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 744ccdecf35590c06795a2c464934c84e748300f..f4baa90d4702363a058fcf385923ff13386790fb 100644 (file)
@@ -1,6 +1,12 @@
 2019-02-07  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];
+}
This page took 0.103884 seconds and 5 git commands to generate.