<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/83534>83534</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [flang] Fir/memory-allocation-opt.fir started randomly failing in Windows pre-merge checks
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang:fir-hlfir
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          jeanPerier
      </td>
    </tr>
</table>

<pre>
    fir-opt crashes in memory-allocation-opt.fir test on windows in the Github pre-merge checks:

https://buildkite.com/llvm-project/github-pull-requests/builds/42658#018df0e3-9218-455d-be9f-2b531f77ac61

```
FAIL: Flang :: Fir/memory-allocation-opt.fir (359 of 2609)
******************** TEST 'Flang :: Fir/memory-allocation-opt.fir' FAILED ********************
Exit Code: 2
Command Output (stdout):
--
# RUN: at line 1
fir-opt --memory-allocation-opt="dynamic-array-on-heap=true maximum-array-alloc-size=1024" C:\ws\src\flang\test\Fir\memory-allocation-opt.fir | c:\ws\src\build\bin\filecheck.exe C:\ws\src\flang\test\Fir\memory-allocation-opt.fir
# executed command: fir-opt '--memory-allocation-opt=dynamic-array-on-heap=true maximum-array-alloc-size=1024' 'C:\ws\src\flang\test\Fir\memory-allocation-opt.fir'
# .---command stderr------------
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
# | Exception Code: 0xC0000005Exception Code: 0xC0000005
# |
# |  #0 0x00007ff7fceb586b (c:\ws\src\build\bin\fir-opt.exe+0x17586b)
# |  #1 0x00007ff7fceb5719 (c:\ws\src\build\bin\fir-opt.exe+0x175719)
# |  #2 0x00007ff7fdbc4a28 (c:\ws\src\build\bin\fir-opt.exe+0xe84a28)
# |  #3 0x00007ff7fdbc62fa (c:\ws\src\build\bin\fir-opt.exe+0xe862fa)
# |  #4 0x00007ff7fdba4bac (c:\ws\src\build\bin\fir-opt.exe+0xe64bac)
# |  #5 0x00007ff7fdba00da (c:\ws\src\build\bin\fir-opt.exe+0xe600da)
# |  #6 0x00007ff7fdba09f5 (c:\ws\src\build\bin\fir-opt.exe+0xe609f5)
# |  #7 0x00007ff7fdb9c3a3 (c:\ws\src\build\bin\fir-opt.exe+0xe5c3a3)
# |  #8 0x00007ff7fceb654e (c:\ws\src\build\bin\fir-opt.exe+0x17654e)
# |  #9 0x00007ff7fd8c6cf7 (c:\ws\src\build\bin\fir-opt.exe+0xb86cf7)
# | #10 0x00007ff7fd8cc7c7 (c:\ws\src\build\bin\fir-opt.exe+0xb8c7c7)
# | #11 0x00007ff7fd8ce2d9 (c:\ws\src\build\bin\fir-opt.exe+0xb8e2d9)
# | #12 0x00007ff7fd8c8a8b (c:\ws\src\build\bin\fir-opt.exe+0xb88a8b)
# | #13 0x00007ff7fd8b615c (c:\ws\src\build\bin\fir-opt.exe+0xb7615c)
# | #14 0x00007ff7fdcc16bf (c:\ws\src\build\bin\fir-opt.exe+0xf816bf)
# | #15 0x00007ff7fdcc0bc8 (c:\ws\src\build\bin\fir-opt.exe+0xf80bc8)
# | #16 0x00007ffbd386268a (C:\Windows\System32\ucrtbase.dll+0x2268a)
# | #17 0x00007ffbd3a27ac4 (C:\Windows\System32\KERNEL32.DLL+0x17ac4)
# | #18 0x00007ffbddb7a4e1 (C:\Windows\SYSTEM32\ntdll.dll+0x5a4e1)
# `-----------------------------
# error: command failed with exit status: 0xc0000005
# executed command: 'c:\ws\src\build\bin\filecheck.exe' 'C:\ws\src\flang\test\Fir\memory-allocation-opt.fir'
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  c:\ws\src\build\bin\filecheck.exe C:\ws\src\flang\test\Fir\memory-allocation-opt.fir
# `-----------------------------
```

The test and pass have not changed in a couple years, and valgrind is green on linux, so it is not immediately clear what is wrong. The pass is currently not used in flang end-to-end compilation flow.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEmEG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