https://bugs.llvm.org/show_bug.cgi?id=51505
Bug ID: 51505
Summary: [execute]binary compile with -O0 run diff to gcc -O0
on aarch64
Product: clang
Version: 12.0
Hardware: Other
OS: Linux
Status: NEW
Severity: release blocker
Priority: P
Component: C
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected],
[email protected]
Created attachment 25147
--> https://bugs.llvm.org/attachment.cgi?id=25147&action=edit
test-creduce.c
yansendao@jvmtest-129:boole-issue2603$ gcc test-creduce.c -Wall && ./a.out
3
yansendao@jvmtest-129:boole-issue2603$ ~/software/llvm12/bin/clang
test-creduce.c -Wall && ./a.out
test-creduce.c:7:10: warning: result of comparison of constant -1 with
expression of type 'unsigned int' is always true
[-Wtautological-constant-out-of-range-compare]
if (~a > -1L)
~~ ^ ~~~
1 warning generated.
0
yansendao@jvmtest-129:boole-issue2603$ ~/software/llvm12/bin/clang -v
clang version 12.0.1
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/yansendao/software/llvm12/bin
Found candidate GCC installation: /usr/lib/gcc/aarch64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/aarch64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/aarch64-linux-gnu/8
Found candidate GCC installation: /usr/lib64/gcc/aarch64-linux-gnu/7
Found candidate GCC installation: /usr/lib64/gcc/aarch64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib64/gcc/aarch64-linux-gnu/8
Selected GCC installation: /usr/lib64/gcc/aarch64-linux-gnu/7.5.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
yansendao@jvmtest-129:boole-issue2603$ cat test-creduce.c
int printf(const char *, ...);
unsigned a;
long b;
short c, d;
long *e = &b;
short f() {
if (~a > -1L)
return 3;
return d;
}
int main() {
c = f();
*e = c;
printf("%d\n", (int)b);
return 0;
}
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs