<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/152241>152241</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
perl 5.40.2 fails to run simple script when compiled with Clang-21.1.0-rc2
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
kraj
</td>
</tr>
</table>
<pre>
I use yocto to build a system using clang as default system compiler. When using clang-21 RC2, resulting perl is not working correctly. A simple reproducer is
```perl
perl -e 'use Getopt::Std;'
```
instead of executing successfully results in
```
panic: magic_killbackrefs (flags=0) at /usr/lib/perl5/5.40.2/warnings.pm line 620.
Compilation failed in require at /usr/lib/perl5/5.40.2/Getopt/Std.pm line 4.
BEGIN failed--compilation aborted at /usr/lib/perl5/5.40.2/Getopt/Std.pm line 4.
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
```
This happens on x86_64 and also on arm64 targets.
If perl is built with `-Doptimize='-O2 -fno-strict-aliasing'` added to configure then it works correctly. It also works file when using just `-O1`
I do not have a narrowed down reproducer than this yet.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykVE2P2zYQ_TX0ZSCBoj7sPejg3a0DXxqgKdBjQJEjibsUqXKoddxfX1DybtxcGiAAAQEazpvHmTdPEpnBIbasfmT1804ucfShfQ3yZdd5fW3PsBDC1avoIXroFmM1SKArRZxgIeMGUFa6ASSBxl4uNr5HlZ9mYzHk8NeI7v5yJgr440kw8QQBabExRWYMFgyB8xEuPryut30IqKK95nAEMtNsEQLOwetFYQBDjB_Tafh2EgbjxxUqQ2Bin-h_wujnyMojK49fomblIxP7-7QNxTiKKDX4HvAbqmVlRYtSSNQv1l5vZAmM-6FuqimdUaw8wiQHo76-Gms7qV4D9gRMHHorB2LlM2fiAWQEJk4LBSZO1nRMnBLjmolTnVc8F0ycLjI44wbK5wmscQiN4Dnjx6e1qTIa76CXxqIG4yDg34sJ-DPAt2aI05eoP8CrBP3426fz7zfQLFN3hWTnQ0T9a_D_yzzD7Xbx02T-k_HDNP8cDcEo5xkdgXfw7dB8bSqQToO05NMvGaamgijDgJHyLe3cfwgxiT3CxcQRWMOzZz9HM5l_kJXPTOyzzwKy3vmMYjAqZtIamRSepNVwAKk16rQzyrveDEtAiGkNzKZuutf2OW6ctkBvLMLl-8q8LBRXBp-Lj9edQft1U0b5hiDByRD8BTVof3H3KxJH6SCmXlwx5rDTbakfyge5w7bY11VV84LXu7GtDryomkPXHITSuj-oju-L-qFvlERZN93OtIKLmh94w8ui5nXeN43al8VDV5Xy0BTIKo6TNDa39m3KfRh2hmjBtqiFqIqdlR1aWo1GCIcXWKNMiOQ7oU1JWbcMxCpuDUX6DhNNtNiuU9lktsqCUm_D4t5tgVQwc9z6dnMevQ3v6WY5eZHzLCixW4JtxxhnSpYgTkycBhPHpcuVn5Ky7dv7J5uDf0GV9LzSJSZOt_e8teLfAAAA__88brI6">