Hi Jakub, thanks for the comment & spec referral. I have now updated the patch – and included the new C/Fortran testcase. On 04.07.22 16:53, Jakub Jelinek via Fortran wrote: > See OpenMP 5.2 [59:31-34]: > A modifier that is an expression must neither lexically match the name of a simple modifier > defined for the clause that is an OpenMP keyword nor modifier-name parenthesized-tokens, > where modifier-name is the modifier-name of a complex modifier defined for the clause and > parenthesized-tokens is a token sequence that starts with ( and ends with ). > > So, ref can't be step expression because it lexically matches the name of a > simple modifier, so linear (var : ref) is equivalent to old style linear (ref (var):1) > while e.g. linear (var : ref + 0) is equivalent to linear (var : step (ref + 0)) I see. > You can certainly try to match "step ( %e ) )" or "step ( %e ) , " first, > those would handle the case of valid complex modifier. Done so + plus some more massage in order to support the following, added as C/Fortran testcase: > But, I think if there is > interface > integer function step (x, y, z) > integer :: x, y, z > end function step > end interface > then > linear (v : step (x, y, z)) > should be rejected, not accepted as valid > linear (v : step (step (x, y, z))) > > I think I should add: > int step (int x, int y, int z) { return x + y + z; } > > int > foo (int x) > { > int i; > #pragma omp parallel for linear (x : step (step (1, 2, 3))) > for (i = 0; i < 64; i++) > x += 6; > return x; > } > > int > bar (int x) > { > int i; > #pragma omp parallel for linear (x : step (1, 2, 3)) /* { dg-error "expected" } */ > for (i = 0; i < 64; i++) > x += 6; > return x; > } > as another testcase (where foo used to be invalid before and bar used to be > valid). Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955