[all-commits] [llvm/llvm-project] d2126e: [flang] Fix bogus error about procedure incompatbi...

Peter Klausler via All-commits all-commits at lists.llvm.org
Tue Sep 10 14:11:31 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d2126ec1af543b23817c742c283ec441f21bf42b
      https://github.com/llvm/llvm-project/commit/d2126ec1af543b23817c742c283ec441f21bf42b
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2024-09-10 (Tue, 10 Sep 2024)

  Changed paths:
    M flang/include/flang/Evaluate/expression.h
    M flang/include/flang/Evaluate/tools.h
    M flang/lib/Evaluate/expression.cpp
    M flang/lib/Evaluate/fold-implementation.h
    A flang/test/Semantics/Inputs/modfile67.mod
    A flang/test/Semantics/modfile67.f90

  Log Message:
  -----------
  [flang] Fix bogus error about procedure incompatbility (#107645)

This was a subtle problem. When the shape of a function result is
explicit but not constant, it is characterized with bounds expressions
that use Extremum<SubscriptInteger> operations to force extents to 0
rather than be negative. These Extremum operations are formatted as
"max()" intrinsic functions in the module file. Upon being read from the
module file, they are not folded back into Extremum operations, but
remain as function references; and this then leads to expressions not
comparing equal when the procedure characteristics are compared to those
of a local procedure declared identically.

The real fix here would be for folding to just always change max and min
function references into Extremum<> operations, constant operands or
not, and I tried that, but it lead to test failures and crashes in
lowering that I couldn't resolve. So, until those can be fixed, here's a
change that will read max/min operations in module file declarations
back into Extremum operations to solve the compatibility checking
problem, but leave other non-constant max/min operations as function
calls.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list