<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - clang -O0 compile crash: IRTranslator.cpp:344 on aarch64 platform"
   href="https://bugs.llvm.org/show_bug.cgi?id=51203">51203</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang -O0 compile crash: IRTranslator.cpp:344 on aarch64 platform
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>12.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>release blocker
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>yansendao@huawei.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=25062" name="attach_25062" title="creduce testcase file">attachment 25062</a> <a href="attachment.cgi?id=25062&action=edit" title="creduce testcase file">[details]</a></span>
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 <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> 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="<a href="https://www.ubuntu.com/">https://www.ubuntu.com/</a>"
SUPPORT_URL="<a href="https://help.ubuntu.com/">https://help.ubuntu.com/</a>"
BUG_REPORT_URL="<a href="https://bugs.launchpad.net/ubuntu/">https://bugs.launchpad.net/ubuntu/</a>"
PRIVACY_POLICY_URL="<a href="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy">https://www.ubuntu.com/legal/terms-and-policies/privacy-policy</a>"
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() {}</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>