<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/56579>56579</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
opt crashes
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
therealviklo
</td>
</tr>
</table>
<pre>
```
0. Program arguments: opt -opaque-pointers --O3 -S -o testopt.ll test.ll
#0 0x00007f6c2ead553a (/usr/lib/libLLVM-14.so+0xcd553a)
#1 0x00007f6c2ead2bcf llvm::sys::RunSignalHandlers() (/usr/lib/libLLVM-14.so+0xcd2bcf)
#2 0x00007f6c2ead2d1d (/usr/lib/libLLVM-14.so+0xcd2d1d)
#3 0x00007f6c2d63e8e0 (/usr/lib/libc.so.6+0x3e8e0)
#4 0x00007f6c303f7aad llvm::RuntimePointerChecking::insert(llvm::Loop*, llvm::Value*, bool, unsigned int, unsigned int, llvm::DenseMap<llvm::Value const*, llvm::Value*, llvm::DenseMapInfo<llvm::Value const*, void>, llvm::detail::DenseMapPair<llvm::Value const*, llvm::Value*> > const&, llvm::PredicatedScalarEvolution&) (/usr/lib/libLLVM-14.so+0x25f7aad)
#5 0x00007f6c303f9c6f (/usr/lib/libLLVM-14.so+0x25f9c6f)
#6 0x00007f6c303fa3f2 (/usr/lib/libLLVM-14.so+0x25fa3f2)
#7 0x00007f6c303fe0c1 llvm::LoopAccessInfo::analyzeLoop(llvm::AAResults*, llvm::LoopInfo*, llvm::TargetLibraryInfo const*, llvm::DominatorTree*) (/usr/lib/libLLVM-14.so+0x25fe0c1)
#8 0x00007f6c303ff230 llvm::LoopAccessAnalysis::run(llvm::Loop&, llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>&, llvm::LoopStandardAnalysisResults&) (/usr/lib/libLLVM-14.so+0x25ff230)
#9 0x00007f6c32278ce9 (/usr/lib/libLLVM-14.so+0x4478ce9)
#10 0x00007f6c304043a1 llvm::AnalysisManager<llvm::Loop, llvm::LoopStandardAnalysisResults&>::getResultImpl(llvm::AnalysisKey*, llvm::Loop&, llvm::LoopStandardAnalysisResults&) (/usr/lib/libLLVM-14.so+0x26043a1)
#11 0x00007f6c2fd434b6 (/usr/lib/libLLVM-14.so+0x1f434b6)
#12 0x00007f6c2fd490b8 (/usr/lib/libLLVM-14.so+0x1f490b8)
#13 0x00007f6c2fd499b3 llvm::LoopLoadEliminationPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/usr/lib/libLLVM-14.so+0x1f499b3)
#14 0x00007f6c32215d26 (/usr/lib/libLLVM-14.so+0x4415d26)
#15 0x00007f6c310ad335 (/usr/lib/libLLVM-14.so+0x32ad335)
#16 0x00007f6c2ec8ead0 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/lib/libLLVM-14.so+0xe8ead0)
#17 0x00007f6c310a03d6 (/usr/lib/libLLVM-14.so+0x32a03d6)
#18 0x00007f6c2ec87bc4 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/lib/libLLVM-14.so+0xe87bc4)
#19 0x00005613c55877b4 llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::StringRef>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool) (/usr/bin/opt+0x317b4)
#20 0x00005613c5577f16 main (/usr/bin/opt+0x21f16)
#21 0x00007f6c2d629290 (/usr/lib/libc.so.6+0x29290)
#22 0x00007f6c2d62934a __libc_start_main (/usr/lib/libc.so.6+0x2934a)
#23 0x00005613c5579fa5 _start (/usr/bin/opt+0x23fa5)
Segmenteringsfel (minnesutskrift skapad)
```
Here is test.ll:
```llvm
; ModuleID = 'test.ll'
source_filename = "test.ll"
target triple = "x86_64-pc-linux-gnu"
@0 = private unnamed_addr constant [5 x i8] c"true\00", align 1
@1 = private unnamed_addr constant [6 x i8] c"false\00", align 1
@2 = private unnamed_addr constant [4 x i8] c"abc\00", align 1
@3 = private unnamed_addr constant [7 x i8] c"%s %s\0A\00", align 1
define void @String(ptr %0, ptr %1, i64 %2) {
entry:
%3 = alloca i64, align 8
store i64 %2, ptr %3, align 4
%4 = getelementptr { ptr, i64 }, ptr %0, i32 0, i32 0
%5 = load i64, ptr %3, align 4
%6 = add i64 %5, 1
%7 = call ptr @malloc(i64 %6)
store ptr %7, ptr %4, align 8
%8 = getelementptr { ptr, i64 }, ptr %0, i32 0, i32 0
%9 = load ptr, ptr %8, align 8
%10 = getelementptr { ptr, i64 }, ptr %0, i32 0, i32 1
%11 = load i64, ptr %3, align 4
store i64 %11, ptr %10, align 4
%12 = getelementptr { ptr, i64 }, ptr %0, i32 0, i32 1
%13 = load i64, ptr %12, align 4
br label %14
14: ; preds = %17, %entry
%15 = load i64, ptr %3, align 4
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %33
17: ; preds = %14
%18 = load i64, ptr %3, align 4
%19 = sub i64 %18, 1
store i64 %19, ptr %3, align 4
%20 = load i64, ptr %3, align 4
%21 = getelementptr { ptr, i64 }, ptr %0, i32 0, i32 0
%22 = load ptr, ptr %21, align 8
%23 = load i64, ptr %3, align 4
%24 = getelementptr i8, ptr %22, i64 %23
%25 = load i64, ptr %3, align 4
%26 = getelementptr i8, ptr %1, i64 %25
%27 = load i8, ptr %26, align 1
store i8 %27, ptr %24, align 1
%28 = getelementptr { ptr, i64 }, ptr %0, i32 0, i32 0
%29 = load ptr, ptr %28, align 8
%30 = load i64, ptr %3, align 4
%31 = getelementptr i8, ptr %29, i64 %30
%32 = load i8, ptr %31, align 1
br label %14
33: ; preds = %14
%34 = getelementptr { ptr, i64 }, ptr %0, i32 0, i32 0
%35 = load ptr, ptr %34, align 8
%36 = getelementptr { ptr, i64 }, ptr %0, i32 0, i32 1
%37 = load i64, ptr %36, align 4
%38 = getelementptr i8, ptr %35, i64 %37
store i8 0, ptr %38, align 1
%39 = getelementptr { ptr, i64 }, ptr %0, i32 0, i32 0
%40 = load ptr, ptr %39, align 8
%41 = getelementptr { ptr, i64 }, ptr %0, i32 0, i32 1
%42 = load i64, ptr %41, align 4
%43 = getelementptr i8, ptr %40, i64 %42
%44 = load i8, ptr %43, align 1
ret void
}
declare ptr @malloc(i64)
define void @"String$$String"(ptr %0, ptr %1) {
entry:
%2 = getelementptr { ptr, i64 }, ptr %1, i32 0, i32 0
%3 = load ptr, ptr %2, align 8
%4 = getelementptr { ptr, i64 }, ptr %1, i32 0, i32 1
%5 = load i64, ptr %4, align 4
call void @String(ptr %0, ptr %3, i64 %5)
%6 = load { ptr, i64 }, ptr %0, align 8
ret void
}
define ptr @"String$$u8*"(ptr %0) {
entry:
%1 = getelementptr { ptr, i64 }, ptr %0, i32 0, i32 0
%2 = load ptr, ptr %1, align 8
ret ptr %2
}
define i64 @"String$size"(ptr %0) {
entry:
%1 = getelementptr { ptr, i64 }, ptr %0, i32 0, i32 1
%2 = load i64, ptr %1, align 4
ret i64 %2
}
define void @"bool$$String"(ptr %0, i1 %1) {
entry:
br i1 %1, label %2, label %4
2: ; preds = %entry
call void @String(ptr %0, ptr bitcast ([5 x i8]* @0 to ptr), i64 4)
%3 = load { ptr, i64 }, ptr %0, align 8
ret void
4: ; preds = %entry
call void @String(ptr %0, ptr bitcast ([6 x i8]* @1 to ptr), i64 5)
%5 = load { ptr, i64 }, ptr %0, align 8
ret void
}
declare void @free(ptr)
define i32 @main(i32 %0, ptr %1) {
entry:
%2 = alloca { ptr, i64 }, align 8
%3 = alloca { ptr, i64 }, align 8
%4 = alloca { ptr, i64 }, align 8
call void @String(ptr %4, ptr bitcast ([4 x i8]* @2 to ptr), i64 3)
%5 = load { ptr, i64 }, ptr %4, align 8
%6 = call ptr @"String$$u8*"(ptr %4)
%7 = getelementptr i8, ptr %6, i8 0
store i8 120, ptr %7, align 1
%8 = call ptr @"String$$u8*"(ptr %4)
%9 = getelementptr i8, ptr %8, i8 0
%10 = load i8, ptr %9, align 1
call void @String(ptr %3, ptr bitcast ([7 x i8]* @3 to ptr), i64 6)
%11 = call ptr @"String$$u8*"(ptr %3)
%12 = call ptr @"String$$u8*"(ptr %4)
call void @"bool$$String"(ptr %2, i1 true)
%13 = call ptr @"String$$u8*"(ptr %2)
%14 = call i32 (ptr, ...) @printf(ptr %11, ptr %12, ptr %13)
%15 = getelementptr { ptr, i64 }, ptr %2, i32 0, i32 0
%16 = getelementptr { ptr, i64 }, ptr %2, i32 0, i32 1
call void @"~String"(ptr %2)
%17 = getelementptr { ptr, i64 }, ptr %3, i32 0, i32 0
%18 = getelementptr { ptr, i64 }, ptr %3, i32 0, i32 1
call void @"~String"(ptr %3)
%19 = getelementptr { ptr, i64 }, ptr %4, i32 0, i32 0
%20 = getelementptr { ptr, i64 }, ptr %4, i32 0, i32 1
call void @"~String"(ptr %4)
ret i32 0
}
declare i32 @printf(ptr, ...)
define void @"~String"(ptr %0) {
entry:
%1 = getelementptr { ptr, i64 }, ptr %0, i32 0, i32 0
%2 = load ptr, ptr %1, align 8
call void @free(ptr %2)
ret void
}
declare i32 @puts(ptr)
declare i32 @scanf(ptr, ...)
define i64 @strlen(ptr %0) {
entry:
%1 = alloca ptr, align 8
%2 = alloca i64, align 8
store i64 0, ptr %2, align 4
%3 = load i64, ptr %2, align 4
store ptr %0, ptr %1, align 8
%4 = load ptr, ptr %1, align 8
br label %5
5: ; preds = %9, %entry
%6 = load ptr, ptr %1, align 8
%7 = load i8, ptr %6, align 1
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i64, ptr %2, align 4
%11 = add i64 %10, 1
store i64 %11, ptr %2, align 4
%12 = load i64, ptr %2, align 4
%13 = load ptr, ptr %1, align 8
%14 = getelementptr i8, ptr %13, i8 1
store ptr %14, ptr %1, align 8
%15 = load ptr, ptr %1, align 8
br label %5
16: ; preds = %5
%17 = load i64, ptr %2, align 4
ret i64 %17
}
define void @"u8 mut*$$String"(ptr %0, ptr %1) {
entry:
call void @"u8*$$String"(ptr %0, ptr %1)
%2 = load { ptr, i64 }, ptr %0, align 8
ret void
}
define void @"u8*$$String"(ptr %0, ptr %1) {
entry:
%2 = call i64 @strlen(ptr %1)
call void @String(ptr %0, ptr %1, i64 %2)
%3 = load { ptr, i64 }, ptr %0, align 8
ret void
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzNW1tT4zoS_jXhxUXKuvj2wAMMUGfqQB1qmJpXSrZl8I5jZ31h4fz6bcmOIzmyY0M4uxQkTtL61P11q9Vqh7CI3y9Wrt392tcr-9Jer-zgoSyeS7axWPncbHheVytyaRXb2jovtuzfDT_fFmle87Kyzs__Itb5I3xg1byqQWadZfISnltEa4WJbdlvNvx4iRthzmLHIQze91f4tqlKeMzSsH28u_t1f47ouipW-Mp-i6ToCgd7LDTAwmGUWFn2ugEl4bd6r9qLH03-mD7nLPuD5XEGysr5gpnTClRtWjycNkbxXCwQ1bCIihW7hPvcNmNFgLJ2JY6U0mCoAkNskniMxQoTQECdbvhD66tvLzz6nebP7WdpXvGyhin34ndFsV3hyxX-pmD8YlnDu3fDosjEc5NXwCuPLcA1vd6PvuYwzT3brsi3AaQVFXlVT053CPM9T4ojUK9FGq_IjT4-5jVLMx3rgaXlcrXIjSX-OilXl3ooeZxGrObxY8QyVt68FllTp0UuJecFHnakFzU3OwM3B5GbzAUTshqYOwBjJMFzwYSsBuYNwLgdIUuPqMso4lXVek68x2BBvv_N22BTou_y8gevmgxSzZB8ISrHDz_4CemJ13dpWLLyXUiMeO-62KQ5q4vyZ8nb4JrtC2GQZrE_sDgRuc1k8aWws0q7XFQ2uWGtDeJnN-QeOHrmenS2A4a0PNaQ2lgZ70b2FLpyDbiLRsxnRRitsRKorGD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