Regression from 2.0 to `version-2-2`/`devel` with `refc`, LTO and `-fstack-usage`
### Nim Version

```
Nim Compiler Version 2.0.15 [Linux: amd64]
Compiled at 2025-03-04
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: 41637db18f6a82df4a92f2e00a780e5815d17028
active boot switches: -d:release
```

```
Nim Compiler Version 2.2.3 [Linux: amd64]
Compiled at 2025-03-04
Copyright (c) 2006-2025 by Andreas Rumpf

git hash: 58f1e22db352ed3cff0f9303acf064a291c25d8d
active boot switches: -d:release
```

```
Nim Compiler Version 2.3.1 [Linux: amd64]
Compiled at 2025-03-04
Copyright (c) 2006-2025 by Andreas Rumpf

git hash: e39d152b89c5635c27dd4d8fc71c48747c5fc20b
active boot switches: -d:release
```

```
gcc (Debian 14.2.0-17) 14.2.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```

### Description

```nim
proc h(): array[524288, byte] =
  # Other conditional-adjacent expressions (case, try, etc) also work here
  if true:
    result
  else:
    result

let v = h()   # to make Nim 2.0 fail too, use discard h()
```

Build with
```
nim c --passC="-flto -fstack-usage -Werror=stack-usage=262144" --passL="-flto -fstack-usage -Werror=stack-usage=262144" --mm:refc s.nim
```

### Current Output

```text
Hint: used config file '/tmp/nimdevel/config/nim.cfg' [Conf]
Hint: used config file '/tmp/nimdevel/config/config.nims' [Conf]
........................................................................
CC: nimdevel/lib/system/exceptions.nim
CC: nimdevel/lib/std/private/digitsutils.nim
CC: nimdevel/lib/system/dollars.nim
CC: nimdevel/lib/std/typedthreads.nim
CC: nimdevel/lib/pure/collections/sharedlist.nim
CC: nimdevel/lib/system.nim
CC: s.nim
Hint:  [Link]
/tmp/tmp.g0j3iBnZfH/@ms.nim.c: In function ‘h__s_u1’:
/tmp/tmp.g0j3iBnZfH/@ms.nim.c:91:15: error: stack usage is 1048656 bytes [-Werror=stack-usage=]
   91 | N_LIB_PRIVATE N_NIMCALL(void, h__s_u1)(tyArray__msnM9cX4aNc7VxW6WzOqyjA Result) {
      |               ^
lto1: some warnings being treated as errors
lto-wrapper: fatal error: gcc returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
Error: execution of an external program failed: 'gcc   -o /tmp/s  /tmp/tmp.g0j3iBnZfH/@mnimdevel@slib@ssystem@sexceptions.nim.c.o /tmp/tmp.g0j3iBnZfH/@mnimdevel@slib@sstd@sprivate@sdigitsutils.nim.c.o /tmp/tmp.g0j3iBnZfH/@mnimdevel@slib@ssystem@sdollars.nim.c.o /tmp/tmp.g0j3iBnZfH/@mnimdevel@slib@sstd@stypedthreads.nim.c.o /tmp/tmp.g0j3iBnZfH/@mnimdevel@slib@spure@scollections@ssharedlist.nim.c.o /tmp/tmp.g0j3iBnZfH/@mnimdevel@slib@ssystem.nim.c.o /tmp/tmp.g0j3iBnZfH/@ms.nim.c.o  -pthread -pthread  -flto -fstack-usage -Werror=stack-usage=262144  -ldl'
```

### Expected Output

```text

```

### Known Workarounds

_No response_

### Additional Information

_No response_