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

    <tr>
        <th>Summary</th>
        <td>
            Extremely Slow Compilation and Timeout with std::ranges::copy and std::views::iota
        </td>
    </tr>

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

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

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

<pre>
    Compiling a C++ program using std::ranges::copy in combination with std::views::iota causes extremely long compilation times (several minutes), sometimes resulting in a forced termination due to exceeded time limits (SIGKILL).

In local it do not end compiling, without giving any feedback.

## Output

```
Killed - processing time exceeded
Program terminated with signal: SIGKILL
Compiler returned: 143
```

## Program

```
#include <algorithm>
#include <iterator>
#include <iostream>
#include <numeric>
int main (int argc, char* argv[])
{
   std::copy (std::make_integer_iterator (1), std::make_integer_iterator (100), std::ostream_iterator<int> (std::cout));
 std::ranges::copy (std::views::iota (1, 100), std::ostream_iterator<int> (std::cout));
   return 0;
}
```

## To quickly reproduce

https://gcc.godbolt.org/z/4q81GE1Pn
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysVE2P2zgM_TXKhZhAluMkPvjgSSfFoAW2QHsfyDLjcEcfqT4yzf76hWxn0850sJcCASKTj-LjI0UZAg0WsWHVPas-LGSKR-cbIz1hxEKIctG5_tLsnDmRJjuAhB0T90zcw8m7wUsDKWR7iD0rW1a2XtoBw3RW7nQBsqCc6cjKSM7CC8XjDX0mfJnB5KIEJVPAAPgjejSoL6CdHXL8ifQUH8lgACa2Ac_opQZDNkUMTNRM7CA4gxPEY0g6Zm5kQcLBeYU9RPTmSqVPCNEB_lCIffaRQdBkKI4Jvj5-_PT4-TMT9ZLxlvH20YJ2SmqgCL0D6yKg7Wd2ZIecP5fnUoSBzqNc9gIHxL6T6nm-hYmSiRL-SvGU4mxa8_nH20-kNfZwl_VVGEZxR2JXmoy3X2bpr8VgP8tKg5WalS1cufN2ah168BiTt5iFh2JVvkp7IzZf_pYZEyVZpVOPwMqd1IPzFI-GlQ9vnBTRy-j8b30uRI_yt3E2GfSkJhfZCEaSzb3IZ-kHlSVWR-mZaPP3eZrb3Hvess094y3AbbrG-cujcjUY-YxPZCMO6J-uJDOiuI7P_yM5f42dC3q6Vb0jG1n58Etu5VIcI2tWjkTffzI_h71-IRPZHfw5HjCPBvDJwDYf3h2Obw6-J1LP-gIeT971SeEEOMZ4GnmKPRP7Qanl4PrO6bh0fmBi_w8T-9X3bfHxofhiF31T9nVZywU2xWa1XteV4PXi2KykEnVVrdfrqt5uVryo5JoXHZZFUXe4KRfUCC4qXvEtr_l6VS-5VNXmsK0O8lCtinXFVhyNJL3U-mxy7gWFkLApyppXxULLDnUY950QFl9g9DIh8vrzTQ6669IQ2IprCjHcrokUNTYP_22mr9q9wO6nzSRtD9_IYH7-v265Nw3O0Pc6vEheN6_UpHhM3VI5w8Q-E5r_7k7e_Y0qMrEfywhM7Oc6z434NwAA__9sOdPA">