https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119659

            Bug ID: 119659
           Summary: [OpenMP] append_args in iobj member function applies
                    to the wrong paramater
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: waffl3x at gcc dot gnu.org
  Target Milestone: ---

Created attachment 61026
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61026&action=edit
Output with -ftree-dump-gimple

Another case that got found in the final stages of my current
patch, already fixed, this is just for records.

The issue is more obvious in the attached tree dump, despite
append_args being specified for parameter 'a', it is instead
adjusting the second parameter 'b' instead.

https://godbolt.org/z/4o4cc46eY
```
struct S {
  template<typename... Ts>
  void v(int *, int *) {}

  #pragma omp declare variant(v) match(construct={dispatch}) \
                                 adjust_args(need_device_ptr: a)
  template<typename... Ts>
  void b(int *a, int *b) {}
};

void f(int *p0, int *p1)
{
  S s{};
  #pragma omp dispatch
  s.b(p0, p1);
}
```

Reply via email to