[all-commits] [llvm/llvm-project] 9d162e: [flang] Create a temporary of the correct size whe...

Valentin Clement (バレンタイン クレメン) via All-commits all-commits at lists.llvm.org
Wed Aug 24 07:56:57 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9d162ecb3b436e84c2b6608814b2d2e2bd4530b1
      https://github.com/llvm/llvm-project/commit/9d162ecb3b436e84c2b6608814b2d2e2bd4530b1
  Author: Valentin Clement <clementval at gmail.com>
  Date:   2022-08-24 (Wed, 24 Aug 2022)

  Changed paths:
    M flang/lib/Lower/ConvertExpr.cpp
    M flang/test/Lower/statement-function.f90

  Log Message:
  -----------
  [flang] Create a temporary of the correct size when lowering SetLength

This patch creates a temporary of the appropriate length while lowering SetLength.

The corresponding character can be truncated or padded if necessary.

This fix issue with array constructor in argument and also with statement function.

```
  character(7) :: str = "1234567"
  call s(str(1:1))
contains
 subroutine s(a)
  character(*) :: a
  call s2([Character(3)::a])
 end subroutine
 subroutine s2(c)
  character(3) :: c(1)
  print "(4a)", c(1), "end"
 end subroutine
end
```

The example prior the patch prints `123end` instead of `1. end`

Reviewed By: PeteSteinfeld, jeanPerier

Differential Revision: https://reviews.llvm.org/D132464




More information about the All-commits mailing list