openmp: Avoid ICEs with declare simd; declare simd inbranch [PR93555]
commit5781600c42f3ed9860a804dbbf892392bea3e39d
authorJakub Jelinek <jakub@redhat.com>
Fri, 14 Feb 2020 14:46:51 +0000 (14 15:46 +0100)
committerJakub Jelinek <jakub@redhat.com>
Fri, 14 Feb 2020 15:01:48 +0000 (14 16:01 +0100)
tree629bf8d20f9c736854c073a1fc6225406b30244f
parenta73ee641c3d2ca729bdf55225afd881f57bf4d96
openmp: Avoid ICEs with declare simd; declare simd inbranch [PR93555]

The testcases ICE because when processing the declare simd inbranch,
we don't create the i == 0 clone as it already exists, which means
clone_info->nargs is not adjusted, but we then rely on it being adjusted
when trying other clones.

2020-02-05  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/93555
* omp-simd-clone.c (expand_simd_clones): If simd_clone_mangle or
simd_clone_create failed when i == 0, adjust clone->nargs by
clone->inbranch.

* c-c++-common/gomp/pr93555-1.c: New test.
* c-c++-common/gomp/pr93555-2.c: New test.
* gfortran.dg/gomp/pr93555.f90: New test.
gcc/ChangeLog
gcc/omp-simd-clone.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/gomp/pr93555-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/gomp/pr93555-2.c [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/pr93555.f90 [new file with mode: 0644]