https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119601
Bug ID: 119601
Summary: [OpenMP] append_args bugs with parameter packs
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: waffl3x at protonmail dot com
Target Milestone: ---
Created attachment 60967
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60967&action=edit
Output of the second case with -ftree-dump-gimple
Both of these are already fixed in my patch,
I'm just posting these for record keeping purposes.
Compiled with -fopenmp
ICE with empty parameter pack.
https://godbolt.org/z/cKq5f4W76
```
typedef enum omp_interop_t : __UINTPTR_TYPE__
{
omp_interop_none = 0,
} omp_interop_t;
template<typename... Args>
void v(int*, Args...) {}
#pragma omp declare variant(v) match(construct={dispatch}) \
append_args(interop(target))
template<typename... Args>
void f(int *, Args...) {}
void foo()
{
#pragma omp dispatch
f(0);
}
```
interop object arguments passed in incorrectly
```
typedef enum omp_interop_t : __UINTPTR_TYPE__
{
omp_interop_none = 0,
__omp_interop_t_max__ = __UINTPTR_MAX__
} omp_interop_t;
template<typename... Args>
void v(int*, Args...) {}
#pragma omp declare variant(v) match(construct={dispatch}) \
append_args(interop(target),interop(targetsync))
template<typename... Args>
void f(int *x, Args...) {}
void foo()
{
#pragma omp dispatch
f(nullptr, 1, 2, 3);
}
```
-ftree-dump-gimple the call expr in .007t.gimple looks like this:
v<int, int, int, omp_interop_t, omp_interop_t> (0B, 1, interop.5, interop.4, 2,
3);
To reiterate, both of these bugs are already fixed.