In the callee side, the value cannot be used directly. For example, the
dummy argument is lhs variable or the dummy argument is passed to
another procedure as actual argument.
Fix this by allocating one temporary storage and store the value. Then
map the symbol of dummy argument to the mlir::Value of the temporary.
I think array dummy arguments with VALUE in BIND(C) interface may be illegal. My rational is that 18.3.6 does not list them as something allowed in a BIND(C) interface. I am surprised the standard to has not been more explicit about this in 8.5.18 (adding it to C865 for instance).
gfortran, nvfortran, xlf, and ifort all raise compile time errors here.
I would be inclined to add a fatal error in lowering instead of supporting it and adding a test until a proper semantic check is added.
I think a more cryptic lowering error is most likely hit for the following anyway: