[PowerPC] Wrong code at -O1
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Reduced tescase: [reduced.c](https://github.com/user-attachments/files/24070790/reduced.c)
The testcase passed the UBSan and ASan: https://godbolt.org/z/dd8Kz49Y5
Reproduce command:
```bash
clang -O1 --target=powerpc64le-unknown-linux-musl -static reduced.c
qemu-ppc64le a.out
clang -O2 --target=powerpc64le-unknown-linux-musl -static reduced.c
qemu-ppc64le a.out
```
Output:
```
BackSmith Checksum = 0x0000000000000005
BackSmith Checksum = 0x0000000000000000
```
clang version 22.0.0git (git@github.com:llvm/llvm-project.git 0e92beb0c0f050e1180c88aa31713f3d6ba9d34e)
Contributor guide
Research direction
Start with the attached reduced.c and run the two clang commands with qemu-ppc64le to reproduce the differing checksums at -O1 and -O2. Then trace the PowerPC compiler path involved in the generated code; the issue is complete when the reduced testcase no longer produces the reported wrong -O1 behavior and the result is verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100