Issue 123948
Summary [flang][openmp] omp_lib does not work when `-fdefault-integer-8` is specified
Labels flang:openmp
Assignees
Reporter jeanPerier
    ```
subroutine bug_with_default_integer_8(i)
  use omp_lib, only : omp_set_num_threads
 integer :: i
  call omp_set_num_threads(i)
end subroutine
```

`flang -fdefault-integer-8 -fopenmp -c`:

```
error: Actual argument type 'INTEGER(8)' is not compatible with dummy argument type 'INTEGER(4)'
```

The opemp standard mandates the signature of omp_set_num_threads to be the default integer, so I think it should work even when the default integer is mapped to something else than integer(4).

gfortran succeeds compiling this example with -fdefault-integer-8, and so does nvfortran with `-i8`. Note that ifort/ifx however compiles with a warning about interface mismatch and most likely produces broken code.

Maybe omp_lib methods should be implemented as generic interfaces allowing multiple kinds?
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to