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

    <tr>
        <th>Summary</th>
        <td>
            [REGRESSION][COROUTINES] infinite loop in addMustTailToCoroResumes
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    Compiling the attached preprocessed source file, perf tells me there's an infinite loop:

```
  99.90% clang-17  [.] addMustTailToCoroResumes
```

Command line: /home/avi/clang.bin/bin/clang++  -x c++ -Werror=unused-result -fstack-clash-protection -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr -DSEASTAR_API_LEVEL=7 -DSEASTAR_BUILD_SHARED_LIBS -DSEASTAR_SCHEDULING_GROUPS_COUNT=16 -DSEASTAR_DEBUG -DSEASTAR_DEFAULT_ALLOCATOR -DSEASTAR_SHUFFLE_TASK_QUEUE -DSEASTAR_DEBUG_SHARED_PTR -DSEASTAR_TYPE_ERASE_MORE -DFMT_SHARED -I/usr/include/p11-kit-1 -ffile-prefix-map=/home/avi/scylla=. -march=westmere -DDEBUG -DSANITIZE -DDEBUG_LSA_SANITIZER -DSCYLLA_ENABLE_ERROR_INJECTION -Og -DSCYLLA_BUILD_MODE=debug -g -gz -iquote. -iquote build/debug/gen --std=gnu++20 -ffile-prefix-map=/home/avi/scylla=. -march=westmere -DBOOST_TEST_DYN_LINK -DNOMINMAX -DNOMINMAX -fvisibility=hidden -Wall -Werror -Wno-mismatched-tags -Wno-tautological-compare -Wno-c++11-narrowing -Wno-ignored-attributes -Wno-overloaded-virtual -Wno-unused-command-line-argument -Wno-unsupported-friend -Wno-delete-non-abstract-non-virtual-dtor -Wno-braced-scalar-init -Wno-implicit-int-float-conversion -Wno-delete-abstract-non-virtual-dtor -Wno-psabi -Wno-narrowing -Wno-nonnull -Wno-uninitialized -Wno-error=deprecated-declarations -DXXH_PRIVATE_API -DSEASTAR_TESTING_MAIN -DFMT_DEPRECATED_OSTREAM -c -o /dev/null multishard.i


[repro.zip](https://github.com/llvm/llvm-project/files/11929499/repro.zip)

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVUuPoz4S_zTOxXIUTB6dQw4kQDc7SegFMo-9IIMriXeMzdomM92ffgVJZtKjXa1W-kvI2FXlernqV8xacVIAKzRbo1k4Yp07a7NiF_FdXIR7G1Wav602ummFFOqE3Rkwc47VZ-C4NdAaXYO1wLHVnakBH4UERDe4BXPEDqS0uIH-mgFEFxYzhYU6CiUcYKl1i_wATUI0ua_zye0bjhgvl-PlBNEZriVTJ-ItMEaz9RjNQsw433XWFUzIQm-00RnYrgH7HzVd141uGqY4lkIB8gOMaHzWDSAas4tANB6MjCuhEI2v60BBdI3oGmPyE9e3PfkCxmiD_LBTnQVODNhOOkyO1rH6O6kls2fSGu2gdkKrnsGUcOIdkB8yzg1Y-5HYKQ5HoYBjclSaPHAurTOYhHkU5EWQlcFrUm6jz9EW-eHigb4-JNuwzF-CLArLbbLOH3j55iUKD9tk_1w-Z-nhNS836WFfID_05g9iYbQ-PH84x8FhW5TBdptugiLNHlW-HOJ4G5VFkH8q_36IDtGfiu6-vBaP94pvr1EZZUEelbs06y_Fu-ImikmCaNxZg2gsVC073j9O63nku3DEw-TYFxhpDRzFT9KwFvnhn49o6zcpGfLDMSYNM_UZ-eEPsK4BA5iEv0IM9kmR_CO6k8ptHpR34uDv5tt2G5TRPlhve4ezNCuT_d-iTZGke0zS02-Za-Z3aRghP-RQdSdM-u8dE_GvTjsY3ze46oTkiMaDFKLxCRQmxDqO_PCkumt50clfEek6TfOiLKK8KMNv-3Kb7D9hEu7TXbLfBV8_bI8XYUUlpHBvyA_PgvPerS9MynulY_JFadII2zDXdz9x7GSvRMc6p6U-iZpJUuumZb35nnPrFs8jihmjf_QQMjDESWkDnDDnjKg6B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