Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

clang -O0 compile crash: IRTranslator.cpp:344 on aarch64 platform #50172

Open Quuxplusone opened 3 years ago

Quuxplusone commented 3 years ago
Bugzilla Link PR51203
Status NEW
Importance P release blocker
Reported by yansendao (yansendao@huawei.com)
Reported on 2021-07-24 02:21:14 -0700
Last modified on 2021-07-26 04:22:47 -0700
Version 12.0
Hardware Other Linux
CC blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk, yansendao@huawei.com
Fixed by commit(s)
Attachments test-creduce.c (99 bytes, text/plain)
Blocks
Blocked by
See also
Created attachment 25062
creduce testcase file

on linux aarch64 machine compile crash:

$ ~/software/llvm12/bin/clang test-creduce.c -c
test-creduce.c:2:5: warning: tentative array definition assumed to have one
element
int b[];
    ^
clang: /home/yansendao/opensource/llvm12/llvm-
project/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp:344: bool
llvm::IRTranslator::translateCompare(const llvm::User&,
llvm::MachineIRBuilder&): Assertion `CI && "Instruction should be CmpInst"'
failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /home/yansendao/software/llvm12/bin/clang test-
creduce.c -c
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'test-creduce.c'.
4.      Running pass 'IRTranslator' on function '@d'
#0 0x0000000002b9c8ec llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/home/yansendao/software/llvm12/bin/clang+0x2b9c8ec)
#1 0x0000000002b9ac50 llvm::sys::RunSignalHandlers()
(/home/yansendao/software/llvm12/bin/clang+0x2b9ac50)
#2 0x0000000002b10d04 CrashRecoverySignalHandler(int)
(/home/yansendao/software/llvm12/bin/clang+0x2b10d04)
#3 0x0000ffffbea68688 (linux-vdso.so.1+0x688)
#4 0x0000ffffbe5b54f8 raise /build/glibc-D9JkfM/glibc-
2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
clang-12: error: clang frontend command failed with exit code 134 (use -v to
see invocation)
clang version 12.0.1
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/yansendao/software/llvm12/bin
clang-12: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-12: note: diagnostic msg: /tmp/test-creduce-44ad96.c
clang-12: note: diagnostic msg: /tmp/test-creduce-44ad96.sh
clang-12: note: diagnostic msg:

********************

$ lscpu
Architecture:        aarch64
Byte Order:          Little Endian
CPU(s):              96
On-line CPU(s) list: 0-95
Thread(s) per core:  1
Core(s) per socket:  48
Socket(s):           2
NUMA node(s):        4
Vendor ID:           0x48
Model:               0
Stepping:            0x1
BogoMIPS:            200.00
L1d cache:           64K
L1i cache:           64K
L2 cache:            512K
L3 cache:            49152K
NUMA node0 CPU(s):   0-23
NUMA node1 CPU(s):   24-47
NUMA node2 CPU(s):   48-71
NUMA node3 CPU(s):   72-95
Flags:               fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp
asimdhp cpuid asimdrdm jscvt fcma dcpop asimddp asimdfhm

$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.4 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

on linux x86-64 machile compile normally:

yansendao@CloudCompiler-145:boole-issue2451$ clang test-creduce.c -c
test-creduce.c:2:5: warning: tentative array definition assumed to have one
element
int b[];
    ^
1 warning generated.
yansendao@CloudCompiler-145:boole-issue2451$ clang -v
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9
Candidate multilib: .;@m64
Selected multilib: .;@m64

$ cat test-creduce.c
int a;
int b[];
void(c)();
void d() {
  for (; 0;)
    c(0x5Cp+1 > (&a == &b[6]));
}
int main() {}
Quuxplusone commented 3 years ago

Attached test-creduce.c (99 bytes, text/plain): creduce testcase file

Quuxplusone commented 3 years ago
creduce again for emilinate compile warning:

int a;
int b[7];
void(c)();
void d() {
  for (; 0;)
    c(0x5Cp+1 > (&a == &b[6]));
}
int main() {}