[flang-commits] [flang] [Flang] Allow Intrinsic simpification with min/maxloc dim and scalar result. (PR #75820)

Pete Steinfeld via flang-commits flang-commits at lists.llvm.org
Thu Dec 21 13:13:25 PST 2023


psteinfeld wrote:

This change breaks some uses of the `maxloc` intrinsic.  Here's a test case:
```
program bug
  integer(1),parameter :: intarray(2) = [ 1, 2 ]
  real,parameter :: realarray(2) = intarray
  call inner(intarray,realarray)
contains
  subroutine inner(intarg,realarg)
    integer(1),intent(in) :: intarg(2)
    real,intent(in) :: realarg(2)
    print *, intarg
    print *, realarg
    print *, maxloc(intarg, dim=1)
    print *, maxloc(realarg, dim=1) ! Should print 2, but prints 1
  end subroutine
end

```
I'm reverting this change in #76184.


https://github.com/llvm/llvm-project/pull/75820


More information about the flang-commits mailing list