<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63690>63690</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Segfault compiling ffmpeg on aarch64 with 17.0.0/trunk
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
kraj
</td>
</tr>
</table>
<pre>
Attached testcase is extracted from ffmpeg when compiled with clang trunk on aarch64
```
1. <eof> parser at end of file 2. Code generation 3. Running pass 'Function Pass Manager' on module 'qpeg-943899.c'.
4. Running pass 'Loop Pass Manager' on function '@decode_frame'
5. Running pass 'Loop Strength Reduction' on basic block '%227'
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 libLLVM-17.so 0x00007ff3dca23b34 llvm::sys::RunSignalHandlers() + 52
1 libLLVM-17.so 0x00007ff3dca23ca6
2 libc.so.6 0x00007ff3db85b6e0
3 libLLVM-17.so 0x00007ff3dd7f3920 llvm::SCEVExpander::expandAddRecExprLiterally(llvm::SCEVAddRecExpr const*) + 144
4 libLLVM-17.so 0x00007ff3dd7ed965 llvm::SCEVExpander::expand(llvm::SCEV const*) + 2725
5 libLLVM-17.so 0x00007ff3dd7eda91 llvm::SCEVExpander::expandCodeForImpl(llvm::SCEV const*, llvm::Type*) + 17
6 libLLVM-17.so 0x00007ff3ddbd7fe3
7 libLLVM-17.so 0x00007ff3ddbe3f9a
8 libLLVM-17.so 0x00007ff3ddbe67f6
9 libLLVM-17.so 0x00007ff3ddbe9810
10 libLLVM-17.so 0x00007ff3de20d09f llvm::LPPassManager::runOnFunction(llvm::Function&) + 1983
11 libLLVM-17.so 0x00007ff3dcb77446 llvm::FPPassManager::runOnFunction(llvm::Function&) + 710
12 libLLVM-17.so 0x00007ff3dcb776d3 llvm::FPPassManager::runOnModule(llvm::Module&) + 51
13 libLLVM-17.so 0x00007ff3dcb77d77 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 919
14 libclang-cpp.so.17 0x00007ff3e4d13249 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream>>) + 5001
15 libclang-cpp.so.17 0x00007ff3e50f1673
16 libclang-cpp.so.17 0x00007ff3e3bbc3ed clang::ParseAST(clang::Sema&, bool, bool) + 1181
17 libclang-cpp.so.17 0x00007ff3e598de59 clang::FrontendAction::Execute() + 185
18 libclang-cpp.so.17 0x00007ff3e5922afa clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 298
19 libclang-cpp.so.17 0x00007ff3e5a0a447 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 967
20 clang-17 0x0000555712ad4938 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 3304
21 clang-17 0x0000555712ad053d
22 clang-17 0x0000555712ad23a3 clang_main(int, char**, llvm::ToolContext const&) + 6963
23 clang-17 0x0000555712acaebf main + 47
24 libc.so.6 0x00007ff3db846a7b
25 libc.so.6 0x00007ff3db846b39 __libc_start_main + 137
26 clang-17 0x0000555712acaf05 _start + 37
./qpeg-943899.sh: line 4: 3254079 Segmentation fault (core dumped)
```
[test.zip](https://github.com/llvm/llvm-project/files/11960184/test.zip)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykV11v2zoS_TXKCxGDIvX54AfXtbcFUjSIiwvsvhgUOZJ5I5G6JJXG99cvqI9YdnqjLjYIbJk6nHM4nBlymLWyUgDrIP4UxJ_vWOdO2qyfDfvzrtDivN44x_gJBHJgHWcWkLQIXp1h3IFApdENKsumhQr9PIFCXDetrEGgn9KdEK-ZqpAznXpGWiHG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