[all-commits] [llvm/llvm-project] 01e22d: [flang] Parenthesize RHS arguments to defined assi...

Peter Klausler via All-commits all-commits at lists.llvm.org
Tue May 16 10:30:10 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 01e22dfb104e7ab4737e512d4e1bbc609962b13e
      https://github.com/llvm/llvm-project/commit/01e22dfb104e7ab4737e512d4e1bbc609962b13e
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2023-05-16 (Tue, 16 May 2023)

  Changed paths:
    M flang/lib/Semantics/expression.cpp
    M flang/test/Lower/array-user-def-assignments.f90
    M flang/test/Lower/user-defined-operators.f90
    M flang/test/Semantics/defined-ops.f90

  Log Message:
  -----------
  [flang] Parenthesize RHS arguments to defined assignments (bug #62599)

The right-hand sides of assignment statements are always expressions,
never variables.  When an assignment statement is converted into a call
to a defined assignment subroutine, and the actual argument being associated
with the second dummy argument is a variable, and the dummy argument does
not have the VALUE attribute, wrap it with parentheses so that lowering
will pass it by means of a temporary.

Fixes https://github.com/llvm/llvm-project/issues/62599.

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




More information about the All-commits mailing list