[flang-commits] [flang] [flang] Allow user to define free via BIND(C) (PR #78428)

via flang-commits flang-commits at lists.llvm.org
Thu Jan 18 00:37:40 PST 2024


jeanPerier wrote:

> LGTM, though, this will still not work in case of function signature mismatch, e.g. if akin to https://github.com/llvm/llvm-project/issues/61074#issuecomment-1459065487 free or malloc is defined by user code with a signature different from the standard one. We should probably report a reasonable error in such cases, but not in this PR.

Right, with this patch this will lead to MLIR errors looking like:

```
error: loc("repro.f90":12:3): 'llvm.call' op incorrect number of operands (1) for callee (expecting: 0)
error: loc("repro.f90":14:3): 'llvm.call' op operand type mismatch for operand 0: '!llvm.ptr' != 'i32'
```

Since the line number may point on allocate/deallocate statement rather than the conflicting free/malloc user def, I agree this is not a very useful hint regarding what is wrong.



https://github.com/llvm/llvm-project/pull/78428


More information about the flang-commits mailing list