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

    <tr>
        <th>Summary</th>
        <td>
            `clangtk` hangs when compiling a simple program that involves loading from or storing to array elements
        </td>
    </tr>

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

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

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

<pre>
    When compiling the following program using `clangtk` with the `-O3` optimization flag, `clangtk` takes up to 90 seconds to complete the compilation process.
```
#include <stdio.h>
int tr[10952];
const int tr2[8][4] = {{1, 0, 0, 1},  {0, 1, -1, 0},  {-1, 0, 0, -1},
                       {0, -1, 1, 0}, {0, -1, -1, 0}, {-1, 0, 0, 1},
                       {0, 1, 1, 0},  {1, 0, 0, -1}};

int ty, k;
int dy;
int main(void) {
  int dx;
  for (k = 0; k < 8; k++) {
    for (dy = (-19 + 1); dy << (19 - 1); dy++) {
      for (dx = (-19 + 1); dx <= (19 - 1); dx++) {
        int tx;
        do {
 *&tx = tr2[k][0] * (dx) + tr2[k][1] * (dy);
          *&ty += tr2[k][2] * (dx) + tr2[k][3] * (dy);
        } while (0);

        tr[(((dy + 19 - 1) * (2 * 19 - 1) + (dx + 19 - 1))) * 1369 + k] =
            ((tx) * (19 + 1) + (ty));
      }
    }
  }
  for (int i = 0; i < sizeof(tr) / sizeof(int); i++)
    printf("%d\n", tr[i]);
  return 0;
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVU2z6igQ_TWdDaVFwHwtsrjRcTvLWccEE0YCFpCreb9-Coia6Nx69SxKgT59TjfdSG0M7yRjJSQVJIeoHm2vdHnjTFslo5Nqp_KfnknUqOHKBZcdsj1DZyWEurnVVatO1wMajVtBihtRy85eIMXoxm3v4ZDizd_Ubamr5QP_VVuuJDqLugOyf_Oy9YUZNF6RVajAyLBGyda4lYtBMMs8ZwgoEF21apgxW8AHwF-Q4nmEJaFcNmJsGQK6N7blatsD_StYubTIakiqGBcJgeQAtAqWRkljUbATSKrcGZNqB8kBAT0gyCrIqtglgJ9fMWQH9-us8wbZo82Metk2b36b2TFIo___PDiD84pzbdq8297l_kTtUwx95h3iz16ntzjdyQEuT4vba6fVcqi5BJJ_K94CKfzJzpF58P0JRuisNAKSX3wJMNAKueke5X4KpPJjxfF0aqdQOJJv4gIBqVxahXP0lr3jAZLHBdosLD9wvljvP7LeA-vhk_X-I2vI2S5zDp9WLaBAvoCkNkiH_ryE_sS-P8lXCM0LkGoNiZeQKYT03gqzwOS8PzTI7zXobzUgO6BbzwVzELxErHH-dgLJw2incMSP03xoED9ZbleP4izhYQQsTQPsMt_oz9sQJO19obMo8UPDTjPxOkN3G57LxWIxnTvIFZy_Gpr7hjb8F1NnR6-D1vG1xaWdG4k_--ilddVc2rOPnQBJWkj20k_34Sy5q9AqXM3sqKVXnyvwiPH5Xxq1JW0LWtQRK-M0T7MEZxmN-pKeMWmKHJNzkhXJ6URxzNpdS86npmh2pIl4STChOI13MU1IQresiGOWF6c2jdMizynsMBtqLrZCfA9bpbuIGzOyMqUUZ5GoT0wY_z4RItkNeaPLJzlEunQ-m9PYGdhhwY01LxbLrWDl-nHpa9kZdFu_aDUy3L0sz8fM9rX75_9W4psZJFTdOthZqwEpjYxV2j-ECtVa1xNigg1MWhONWpS9tVcD9AvIEcix47YfT9tGDUCOLrL5Z3PV6l_WWCBHn48BcvT5_hcAAP__PsDqsw">