As found by Marcel, the 'depend' clause was differently handled in 'omp depobj(...) depend(...)' and in 'omp task depend(...)'. The problem was that for a scalar pointer, depobj depended on the pointer address - while task depended on the pointer-target address. If one now combines depobj and direct var dependency, the dependency is on different addresses, such that the dependency is not honored. Marcel's example is testsuite/libgomp.fortran/depend-4.f90. (Thanks for the report!) I think in the real world, the problem is not that big as most code either uses depobj or a variable and does not mix them. Likewise, using the address of a temporary variable (cf. below) will also usually work in terms of dependency. The attached patch does: - depend clause (as used by task etc): For scalar allocatable/pointer, add another dereference - For depobj (which handles the depend clause by itself) - Fix array(element) handling by coping the depend-clause. Before the result was 'D.123 = var; depobj = &D.123;' which is really not intended. - Several issues related to optional and allocatable/pointer. OK for mainline? Does backporting to GCC 11 make sense? Thanks, Tobias PS: * I use the address of the pointer target (and not of the internal pointer) variable, which requires that the address to which the pointer points makes sense. (Technically, NULL and random value should be also okay, I think.) * Likewise for 'allocatable' - which also requires that the memory is allocated. * OpenMP uses the word 'storage location', which is defined according to the last F2F meeting as: "A data storage block in memory." (OpenMP Spec Pull Req. #3228) * On the OpenMP side, there is the discussion to have a dependency on an integer value instead of an address. (Motivated by the question whether ptr = NULL; (void*)0x123; etc. should be valid or not.) → OpenMP Spec Issue #3226 ----------------- 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