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

    <tr>
        <th>Summary</th>
        <td>
            Clang 18 is much slower to compile large file in Postgres repo than GCC with -Og
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    While investigating Postgres compile times I noticed that compile times of specific file were much larger than other files. Especially when compiling with clang and especially when compared to `gcc` with the `-Og` flag. 

To reproduce:
1. git clone https://github.com/postgres/postgres
2. cd postgres
3. Run this script: [compile.sh.txt](https://github.com/llvm/llvm-project/files/14902948/compile.sh.txt)

Results on my machine are as follows:
gcc 11.4.0: 7.276s
clang 18.1.3: 17.216s
gcc 11.4.0 --debug: 7.441s
clang 18.1.3 --debug: 18.164s
gcc 11.4.0 --debug -Og: 2.418s
clang 18.1.3 --debug -Og: 14.864s

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU01vpDgQ_TXmUmrLNqaBA4d8bK92L1lFK83Zbaptj9wY2SY9-fcjQ-djokykuQB6Ve9RX0-l5MyEOJDmljT3lVqyDXH4F33GQ3UM4_PwzTqP4KYnTNkZld1k4L-QsomYQIfzXMLZnTHBPzCF7DSOkK3KH4LhBGlG7U5Ow6nAF4wI50Vb8CoajIU0QcgW45qQKPy1MpT3z3CxOF0VSwUXly1oryYDahoBP0lUsRQSgOyZ0Zrs2UbKFgu0ezAFOnllKBB2T9jN9vw_QMQ5hnHRSOoryCkYl0H7MCHYnOdUQuJAxMG4bJcj1eFMxGG-Dub95yogKOgRfsVqCo_LBNm6BElHN2dS3wBpbq-Do8nS_COT5p6I7oufev_08trNMXxHnYk4rCMk4sBlz0QvOyIOH3RF_77vR0yLzwnCBOdnOCtt3YSgIoJKcAreh0t6nYfRGjinkrJScktFu782te2Ed5TTusR4SwV_Cb7RYLcb8biYjS4l_4T-Pqcge_lbGSjrrG9AUMm7L6Re8rik3atcNQ712Ne9qnDgLRfNvuFcVHbQXa8EE6IRXS-beq_ZsW15143t2I_7WlZuEExIJlnHupo3ggqmuqPoRymRqb4TRDI8K-dpWQ4N0VQupQWHru3buvLqiD6t3hNiLZcIUWwYh3WZx8UkIpl3Kac3heyyx-Hu2h24tJko-XApJgqvvltttXnNTW-ejTiHzWt_391tntg9mGqJfvjjI1u7KVe2NvQzAAD__9ZHV-k">