[flang-commits] [PATCH] D150331: [flang] Parenthesize RHS arguments to defined assignments (bug #62599)

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed May 10 16:53:03 PDT 2023


klausler created this revision.
klausler added a reviewer: jeanPerier.
klausler added a project: Flang.
Herald added subscribers: sunshaoce, jdoerfert.
Herald added a project: All.
klausler requested review of this revision.

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.


https://reviews.llvm.org/D150331

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150331.521162.patch
Type: text/x-patch
Size: 115995 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230510/50257ff4/attachment-0001.bin>


More information about the flang-commits mailing list