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

    <tr>
        <th>Summary</th>
        <td>
            [flang] Function call in a declaration loops infinitely at run time
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang
      </td>
    </tr>

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

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

<pre>
    This derives from test 0251_0187 from the [Fujitsu test suite](https://github.com/fujitsu/compiler-test-suite).

Line 39 of this test contains a declaration contains a complicated expression with function calls:
```
CHARACTER(LEN=SIZE(arr,fun(fun1()))+2)::aa
```

The value of the expression `fun(fun1())` is 2.  So this declaration should be equivalent to
```
CHARACTER(LEN=SIZE(arr,2)+2)::aa
```

And when I change the test to contain this alternate declaration, it passes.  But the unmodified test seems to hang when executed.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU8Fq6zgU_Rp5c0mQr-LYXnjhJDVTKLNou5rNoFjXsYoseSwpbf9-sJ3yQnk83gOBQNxz7jn2OdJ7fbFEFcsOLDslMobeTdXoA2nbkVHJ2anP6rXXHhRN-koeuskNEMgH4Jil__K0yG9vPQHLDk1808HHdcRHHYhlJ4ZFH8LomagZNgybiw59PG9bNzBsuhXCsGndMGpD02ZGb1Y0llvGa8brJ20JRAmugzArWja0zgaprQcJilojJxm0s_fPM6fRrQykgD7GibyfJ9516KGLtl3npTGLOl6zPb8dXh__qp_r4-vDM8Pi6eFvJk4vj_88MCzkNDE8dtEyLLpoU4YFw_LrHHC-RM1ELeU3Ssbr157gKk2k1Qrdy2J7_jPWPQftAbcAL251f-_W9y4aBWcC-i_qqzRkAwT3Z2bwd6TXVsF7TxYeoe2lvdCif_kTwX199VWgNIEmKwPdS2V4BB1glN6T3wIcYlgYoh2c0p0mdQsO0eBnynnJupE-qI2B1JyGRFVClaKUCVVpLjAXZZEWSV8VCgte8LQ7l7k8CymE4kUmVSdp13ZCJLpCjrs0xRy52GfFlmOac0wlibzLuczYjtMgtdkacx22brok2vtIVZrmJfLEyDMZvxQGsTPSXhji3J2pmgGbc7x4tuNG--B_UAQdzNKyFZGdoLlPHmj7Lb_GudGDtp22OpD5BBlgihaCHiiJk6l-Uad56-3ajJN7ozYwbBYXnmFzM3Kt8P8AAAD__yIaQ98">