[flang-commits] [flang] [flang] Add lowering of volatile references (PR #132486)

Daniel Chen via flang-commits flang-commits at lists.llvm.org
Mon May 5 13:42:55 PDT 2025


DanielCChen wrote:

> Ah, you were asking about the warning. This series of patches only deals with the lowering of volatile entities, not anything in the frontend. @akuhlens added a warning last week I think, I'll ask him about this.

Oh I see. Yeah, the warning should be removed. Thanks!

I got the assert in lowering for another case.
```
  MODULE M

  TYPE :: DT
    CHARACTER :: C0="!"
    INTEGER   :: I=0
    CHARACTER :: C1="!"
  END TYPE

  END MODULE

  PROGRAM dataPtrVolatile
  USE M
  IMPLICIT NONE

  TYPE(DT),  VOLATILE , TARGET  :: Arr(100, 100), Arr1(10000), T(100,100)
  CLASS(DT), VOLATILE , POINTER :: Ptr(:, :)
  INTEGER             :: I, J


  DO I =1, 100
  DO J =I, 100

    Arr(I:, J:) = DT(I=-I)

    Ptr(I:, J:) => Arr(I:, J:)
    T(I:, J:) = Ptr(I:, J:)
  END DO
  END DO


  END
  
error: loc("/home/cdchen/temp/t5.f":26:5): failed to legalize unresolved materialization from ('!fir.class<!fir.array<?x?x!fir.type<_QMmTdt{c0:!fir.char<1>,i:i32,c1:!fir.char<1>}>>, volatile>') to ('!fir.class<!fir.array<?x?x!fir.type<_QMmTdt{c0:!fir.char<1>,i:i32,c1:!fir.char<1>}>>>') that remained live after conversion
error: failure in HLFIR to FIR conversion pass
error: Lowering to LLVM IR failed
error: loc("/home/cdchen/temp/t5.f":1:3): LLVM Translation failed for operation: fir.global
error: failed to create the LLVM module
  ```

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


More information about the flang-commits mailing list