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  <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
This commit is contained in:
Jakub Jelinek 2019-08-30 13:34:08 +02:00 committed by Jakub Jelinek
parent 345ef95706
commit 36536c8b85
4 changed files with 29 additions and 0 deletions

View 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

View 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

View 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

View File

@ -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];
}