[all-commits] [llvm/llvm-project] 3acdd5: [flang] Handle correctly user defined assignment f...

Valentin Clement (バレンタイン クレメン) via All-commits all-commits at lists.llvm.org
Fri Apr 7 11:48:08 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3acdd596c0d7a51038f1be4a9bbc86ba288301ba
      https://github.com/llvm/llvm-project/commit/3acdd596c0d7a51038f1be4a9bbc86ba288301ba
  Author: Valentin Clement <clementval at gmail.com>
  Date:   2023-04-07 (Fri, 07 Apr 2023)

  Changed paths:
    M flang/runtime/assign.cpp

  Log Message:
  -----------
  [flang] Handle correctly user defined assignment for allocatable component

In the Fortran standard 2018 section 10.2.1.3 (13), it is mentioned
that all noncoarray allocatable component must follow this sequence of
operations:

1) If the component of the variable is allocated, it is deallocated.
2) If the component of the value of expr is allocated, the corresponding
   component of the variable is allocated with the same dynamic type and
   type parameters as the component of the value of expr. If it is an
   array, it is allocated with the same bounds. The value of the
   component of the value of expr is then assigned to the corresponding
   component of the variable using defined assignment if the declared type
   of the component has a type-bound defined assignment consistent with the
   component, and intrinsic assignment for the dynamic type of that component
   otherwise.

This patch updates the code to make use of the user defined assignment for
allocatable component and make sure the component is allocated correctly.

Reviewed By: klausler

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




More information about the All-commits mailing list