[llvm-bugs] [Bug 36864] New: segfault in pass 'X86 DAG->DAG Instruction Selection' / fatal error: error in backend: Cannot select: 0x2cd2bb0: i64 = any_extend 0x2cd2940

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 21 23:38:10 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=36864

            Bug ID: 36864
           Summary: segfault in pass 'X86 DAG->DAG Instruction Selection'
                    / fatal error: error in backend: Cannot select:
                    0x2cd2bb0: i64 = any_extend 0x2cd2940
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: vegard.nossum at gmail.com
                CC: llvm-bugs at lists.llvm.org

Input:

void d() {
  struct f {
    int c;
    int *b;
    int *e;
  } a;

  asm("" : "=rm" (a) : "0" (1));
}

Output:

>From godbolt.org:

#0 0x0000000001fd731a
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x1fd731a)
#1 0x0000000001fd53fe
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x1fd53fe)
#2 0x0000000001fd554c
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x1fd554c)
#3 0x00007fd362c4e390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x0000000000a80d6a
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0xa80d6a)
#5 0x000000000289c154
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x289c154)
#6 0x000000000289cc2a
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x289cc2a)
#7 0x00000000028c3070
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x28c3070)
#8 0x00000000028cf821
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x28cf821)
#9 0x00000000028d6fcc
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x28d6fcc)
#10 0x00000000029155bb
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x29155bb)
#11 0x000000000291ae31
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x291ae31)
#12 0x000000000291cc32
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x291cc32)
#13 0x00000000013999c4
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x13999c4)
#14 0x00000000017f8a51
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x17f8a51)
#15 0x0000000001ade83a
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x1ade83a)
#16 0x0000000001ade8e3
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x1ade8e3)
#17 0x0000000001ade3f4
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x1ade3f4)
#18 0x00000000021a9cee
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x21a9cee)
#19 0x00000000021abdc2
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x21abdc2)
#20 0x00000000029d4674
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x29d4674)
#21 0x0000000002f06410
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x2f06410)
#22 0x00000000029d3c57
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x29d3c57)
#23 0x00000000025767ae
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x25767ae)
#24 0x0000000002541e46
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x2541e46)
#25 0x0000000002609f2c
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x2609f2c)
#26 0x0000000000a312e8
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0xa312e8)
#27 0x0000000000994921
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0x994921)
#28 0x00007fd361bd3830 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x20830)
#29 0x0000000000a2e839
(/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0+0xa2e839)
Stack dump:
0.      Program arguments:
/opt/compiler-explorer/clang-trunk-20180321/bin/clang-7.0 -cc1 -triple
x86_64-unknown-linux-gnu -S -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name example.cpp -mrelocation-model static
-mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-dwarf-column-info -debug-info-kind=limited -dwarf-version=4
-debugger-tuning=gdb -coverage-notes-file
/tmp/compiler-explorer-compiler118222-63-8sk2ta.ofv0j/output.gcno -resource-dir
/opt/compiler-explorer/clang-trunk-20180321/lib/clang/7.0.0 -c-isystem
/usr/include/x86_64-linux-gnu -cxx-isystem /usr/include/x86_64-linux-gnu
-internal-isystem
/opt/compiler-explorer/gcc-7.2.0/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0
-internal-isystem
/opt/compiler-explorer/gcc-7.2.0/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0/x86_64-linux-gnu
-internal-isystem
/opt/compiler-explorer/gcc-7.2.0/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0/backward
-internal-isystem /usr/local/include -internal-isystem
/opt/compiler-explorer/clang-trunk-20180321/lib/clang/7.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdeprecated-macro -fdebug-compilation-dir /compiler-explorer -ferror-limit 19
-fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -mllvm --x86-asm-syntax=intel -o
/tmp/compiler-explorer-compiler118222-63-8sk2ta.ofv0j/output.s -x c++ <source> 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module '<source>'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@_Z1dv'
clang-7.0: error: unable to execute command: Segmentation fault (core dumped)
clang-7.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 7.0.0 (trunk 328076)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/compiler-explorer/clang-trunk/bin
clang-7.0: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang-7.0: note: diagnostic msg: 
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-7.0: note: diagnostic msg: /tmp/example-b7179f.cpp
clang-7.0: note: diagnostic msg: /tmp/example-b7179f.sh
clang-7.0: note: diagnostic msg: 
********************
Compiler returned: 254

On my local machine (but an older version):

fatal error: error in backend: Cannot select: 0x2cd2bb0: i64 = any_extend
0x2cd2940
In function: _Z1dv
clang: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 5.0.0-3~16.04.1 (tags/RELEASE_500/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/1521687989-2dee1f.cpp
clang: note: diagnostic msg: /tmp/1521687989-2dee1f.sh
clang: note: diagnostic msg: 

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

-- 
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/20180322/63dc20a6/attachment.html>


More information about the llvm-bugs mailing list