Issue 83722
Summary [Flang][OpenMP] verification of lowering to FIR failed with "the type of the operand must be a pointer type whose element type is the same as that of the region argument"
Labels flang
Assignees
Reporter k-arrows
    Reproducible on Godbolt
https://godbolt.org/z/P8qY5PqMd

Reproducer (reduced from https://github.com/gcc-mirror/gcc/blob/master/libgomp/testsuite/libgomp.fortran/omp_atomic4.f90)
```console
$ cat omp_atomic4_reduced.f90
    real :: c
    double precision :: c2
!$omp atomic capture
    c2 = c
    c = 2.0 * c
!$omp end atomic
end
$ flang-new -fopenmp omp_atomic4_reduced.f90
error: loc("/tmp/omp_atomic4_reduced.f90":1:5): the type of the operand must be a pointer type whose element type is the same as that of the region argument
error: verification of lowering to FIR failed
```

If I change `c = 2.0 * c` in the program into `c = 2.0`, the following is obtained. So I think this is related to (or essentially identical to) https://github.com/llvm/llvm-project/issues/83144.
```console
error: address must dereference to value type
error: verification of lowering to FIR failed
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to