[llvm-bugs] [Bug 51505] New: [execute]binary compile with -O0 run diff to gcc -O0 on aarch64
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Aug 17 05:32:29 PDT 2021
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: unassignedclangbugs at nondot.org
Reporter: yansendao at huawei.com
CC: blitzrakete at gmail.com, dgregor at apple.com,
erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk
Created attachment 25147
--> https://bugs.llvm.org/attachment.cgi?id=25147&action=edit
test-creduce.c
yansendao at jvmtest-129:boole-issue2603$ gcc test-creduce.c -Wall && ./a.out
3
yansendao at 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 at 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 at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210817/ae511239/attachment.html>
More information about the llvm-bugs
mailing list