[all-commits] [llvm/llvm-project] c4360b: [flang] Fix folding of ac-implied-do indices in st...

Peter Klausler via All-commits all-commits at lists.llvm.org
Thu Dec 9 18:03:21 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c4360b4547168f7c0356b49d90646666d5b778da
      https://github.com/llvm/llvm-project/commit/c4360b4547168f7c0356b49d90646666d5b778da
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2021-12-09 (Thu, 09 Dec 2021)

  Changed paths:
    M flang/lib/Evaluate/fold-implementation.h
    M flang/lib/Evaluate/fold.cpp
    A flang/test/Evaluate/folding30.f90

  Log Message:
  -----------
  [flang] Fix folding of ac-implied-do indices in structure c'tors

Array constructors with implied DO loops that oversee structure
constructors were being prematurely folded into invalid constants
containing symbolic references to the ac-implied-do indices,
because they are indeed "constant expressions" as that term is
used in the Fortran standard and implemented as IsConstantExpr().
What's actually needed in structure constructor folding is a
test for actual constant values, which is what results from
folding them later with repetition in the context of folding
an ac-implied-do.

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




More information about the All-commits mailing list