| Issue |
63327
|
| Summary |
Wrong code at -O1/2/3/s on x86_64-linux_gnu
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
shao-hua-li
|
This looks like a quite recent regression, `opt-bisect-limit` to `InstCombinePass`
Compiler explorer: https://godbolt.org/z/rKaWbhP46
```console
% cat a.c
int printf(const char *, ...);
short a;
int b = 6, d;
short *c = &a;
int main() {
d = (b & -b ^ b) < 0;
*c = d;
printf("%d\n", a);
}
%
% clang-tk -O0 a.c && ./a.out
0
% clang-tk -O1 a.c && ./a.out
1
% clang-tk -O2 a.c && ./a.out
1
% clang-tk -O3 a.c && ./a.out
1
% clang-tk -Os a.c && ./a.out
1
%
% clang-tk -v
clang version 17.0.0 (https://github.com/llvm/llvm-project.git 53d405762219d798286b99c297098a14643440fe)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /zdata/shaoli/compilers/ccbuilder-compilers
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/11
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/11
Candidate multilib: .;@m64
Selected multilib: .;@m64
%
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs