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

    <tr>
        <th>Summary</th>
        <td>
            SVE VLA miscompiles GCC torture scal-to-vec1.c
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:AArch64,
            SVE
      </td>
    </tr>

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

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

<pre>
    Since https://lab.llvm.org/buildbot/#/builders/197/builds/3475 we have been seeing https://github.com/llvm/llvm-test-suite/blob/main/SingleSource/Regression/C/gcc-c-torture/execute/scal-to-vec1.c fail to execute.

Looking at it locally it is coredumping because abort is called during one of the vector compares.

Bisecting this I got down to https://reviews.llvm.org/D138872 / b95646fe7058471cc0ecda1efa25003009af0317.

At this commit, the program aborts when compiled with:
```
$ /home/david.spickett/build-llvm-aarch64/bin/clang -mcpu=a64fx -O3 /home/david.spickett/llvm-test-suite/SingleSource/Regression/C/gcc-c-torture/execute/scal-to-vec1.c -o /tmp/test.o && /tmp/test.
```

Note that that is compiling with `-O3`. Turns out that it fails at 0, 1, 2 and 3.

One commit prior (d5b0de35bdd9a3f4d4a093e7938b06add34678eb) it will only crash when compiled with `-O0`. 1, 2 and 3 all work.

Which sounds to me like the "bad" commit changed some process that was covering up some bad decision making.

Reproducer and testing against previous released versions to follow.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVM2O4zYTfBr60pBBkfqxDjp4x-sPH7DIAOtgcuZPS2KGEgWSsnfePqBkJ-vNIsghwKBHZNPdxapqihBMPyG2pPxEytNOLHFwvj2Jq9GX2ah3jHEnnf5oL2ZSCEOMcyD8SNiZsLMVcm_tddw73xN2louxWrq4JvljA30g7Jw39WMjLXlRl3BDGMQVQSJOEBDN1P_QoDdxWOReuTF1s9fHvyxiiFlYTMRU1TpJ2HkUZiLsfDF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