From: Jakub Jelinek Date: Fri, 30 Aug 2019 11:34:08 +0000 (+0200) Subject: backport: re PR c++/66676 (pragma omp simd aligned(x) results in "internal compiler... X-Git-Tag: releases/gcc-7.5.0~267 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36536c8b85bd53137c3241110ccb75bcaad7129a;p=thirdparty%2Fgcc.git backport: re PR c++/66676 (pragma omp simd aligned(x) results in "internal compiler error: Segmentation fault") Backported from mainline 2019-01-29 Jakub Jelinek PR c++/66676 PR ipa/89104 * omp-simd-clone.c (simd_clone_clauses_extract) : Ignore clauses with NULL OMP_CLAUSE_ALIGNED_ALIGNMENT. * gcc.dg/gomp/pr89104.c: New test. From-SVN: r275094 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a3bc11114a57..3747d5d57ea9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,14 @@ 2019-08-30 Jakub Jelinek Backported from mainline + 2019-01-29 Jakub Jelinek + + PR c++/66676 + PR ipa/89104 + * omp-simd-clone.c (simd_clone_clauses_extract) + : Ignore clauses with NULL + OMP_CLAUSE_ALIGNED_ALIGNMENT. + 2019-01-28 Jakub Jelinek PR middle-end/89002 diff --git a/gcc/omp-simd-clone.c b/gcc/omp-simd-clone.c index 9af80a45eb8f..7815ce929ae5 100644 --- a/gcc/omp-simd-clone.c +++ b/gcc/omp-simd-clone.c @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c12d9ebf82a5..d3d1d59c42cc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,6 +1,12 @@ 2019-08-30 Jakub Jelinek Backported from mainline + 2019-01-29 Jakub Jelinek + + PR c++/66676 + PR ipa/89104 + * gcc.dg/gomp/pr89104.c: New test. + 2019-01-27 Jakub Jelinek 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 index 000000000000..505fdda90028 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/pr89104.c @@ -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]; +}