<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/89145>89145</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
regression for SCCP pass on "Illegal instruction (core dumped)
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
diggerlin
</td>
</tr>
</table>
<pre>
in the following test case.
bash> cat a.c
```
char* foo(char*);
int main()
{
char k[1];
if (k[0] == 'a')
foo(k);
}
```
bash> clang -O2 --target=powerpc64le-unknown-linux-gnu -o a.ll -emit-llvm -S a.c
bash> cat a.ll
```
; Function Attrs: mustprogress nofree norecurse noreturn nosync nounwind willreturn memory(none) uwtable
define dso_local noundef signext i32 @main() local_unnamed_addr #0 {
entry:
unreachable
}
```
bash> clang -O2 -o a.o --target=powerpc64le-unknown-linux-gnu -c a.c
bash> objdump -D a.o
a.o: file format elf64-powerpcle
Disassembly of section .text:
```
0000000000000000 <main>:
...
```
Disassembly of section .comment:
it get an empty .text section.
if I have b.c
bash> cat b.c
```
void foo(char* s) {
s[0]='a';
}
```
$ clang -O2 -o b.o --target=powerpc64le-unknown-linux-gnu -c b.c
$ clang -O2 -o test a.o b.o
$ ./test
Illegal instruction (core dumped)
it has Illegal instruction.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVc2OozgQfprKpQQCGxJy4NDdTKQ57UrzAC0DBXja2JFtOp23XxmYJJ3J7k5bURK7XH9ffVUWzsleE5WQP0NebcTkB2PLVvY9WSX1pjbtuZQa_UDYGaXMSeoePTmPjXAUQ1JB8lQLNwD_ho3wKOJmOYRtsn7mbTMIC-wJO2OAFesO2B7483JBao-jkBpYEY4XG7tViOsKevgG-XMKeXVRRdkhsCKcJ5BXCLwCXiGwnQC2u1jDy1qCeLt1D7vqYdx3GSqhe4z-YohR5IXtyQOvjuZE9thsM0XRpN-0OelIST19RL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