[llvm-bugs] [Bug 48480] New: [AVR] clang++ crashes compiling inline assembly for _crc_ccitt_update

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Dec 11 00:12:47 PST 2020


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

            Bug ID: 48480
           Summary: [AVR] clang++ crashes compiling inline assembly for
                    _crc_ccitt_update
           Product: libraries
           Version: 11.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: AVR
          Assignee: unassignedbugs at nondot.org
          Reporter: david.hebbeker at gmail.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 24265
  --> https://bugs.llvm.org/attachment.cgi?id=24265&action=edit
source code to be compiled crc.cpp

clang++ crashes attempting to compile attached code with inline assembly.

In order to reproduce, compile attached source file crc.cpp like this:

    clang++ -v -c --target=avr crc.cpp

The result is that the command fails (running pass 'AVR Assembly Printer').
Backtrace attached below. I expected that clang would either output compiled
code or report an error in the code to be compiled in a readable form.

The source file is a reduced minimal crashing code. Originally attempting to
compile the function `_crc_ccitt_update` in [crc16.h][1] which is part of the
[avr-libc][2].

[1]: https://www.nongnu.org/avr-libc/user-manual/crc16_8h_source.html
[2]: http://www.nongnu.org/avr-libc/

---

$ clang++ -v -c --target=avr crc.cpp
clang version 11.0.0
Target: avr
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
 (in-process)
 "C:\\Program Files\\LLVM\\bin\\clang++.exe" -cc1 -triple avr -emit-obj
-mrelax-all -disable-free -disable-llvm-verifier -discard-value-names
-main-file-name crc.cpp -mrelocation-model static -mframe-pointer=all
-fmath-errno -fno-rounding-math -mconstructor-aliases -fno-split-dwarf-inlining
-debugger-tuning=gdb -v -resource-dir "C:\\Program
Files\\LLVM\\lib\\clang\\11.0.0" -fdeprecated-macro -fdebug-compilation-dir
"C:\\Users\\hebbeker.ST\\Documents\\llvm-bugs" -ferror-limit 19
-fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -faddrsig -o crc.o -x c++
crc.cpp
clang -cc1 version 11.0.0 based upon LLVM 11.0.0 default target
x86_64-pc-windows-msvc
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 C:\Program Files\LLVM\lib\clang\11.0.0\include
End of search list.
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: C:\Program Files\LLVM\bin\clang++.exe -v -c
--target=avr crc.cpp
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'crc.cpp'.
4.      Running pass 'AVR Assembly Printer' on function
'@_Z16crc_ccitt_updatejj'
 #0 0x00007ff694240ef3 C:\Program Files\LLVM\bin\clang++.exe 0x16b0ef3
C:\Program Files\LLVM\bin\clang++.exe 0x668195
 #1 0x00007ff694240ef3 C:\Program Files\LLVM\bin\clang++.exe 0x646fd0
C:\Program Files\LLVM\bin\clang++.exe 0x22886c1
 #2 0x00007ff694240ef3 C:\Program Files\LLVM\bin\clang++.exe 0x227abb1
C:\Program Files\LLVM\bin\clang++.exe 0x6472a9
 #3 0x00007ff694240ef3 C:\Program Files\LLVM\bin\clang++.exe 0x11623cd
C:\Program Files\LLVM\bin\clang++.exe 0x136a4f9
 #4 0x00007ff694240ef3 C:\Program Files\LLVM\bin\clang++.exe 0x136ff93
C:\Program Files\LLVM\bin\clang++.exe 0x136aae0
 #5 0x00007ff694240ef3 C:\Program Files\LLVM\bin\clang++.exe 0x1b5c8cd
C:\Program Files\LLVM\bin\clang++.exe 0x3b3a8bf
 #6 0x00007ff694240ef3 C:\Program Files\LLVM\bin\clang++.exe 0x2c0c0b3
C:\Program Files\LLVM\bin\clang++.exe 0x2068cc2
 #7 0x00007ff694240ef3 C:\Program Files\LLVM\bin\clang++.exe 0x202fbac
C:\Program Files\LLVM\bin\clang++.exe 0x20ce998
 #8 0x00007ff694240ef3 C:\Program Files\LLVM\bin\clang++.exe 0x6be8 C:\Program
Files\LLVM\bin\clang++.exe 0x4294
 #9 0x00007ff694240ef3 C:\Program Files\LLVM\bin\clang++.exe 0x1fc74d6
C:\Program Files\LLVM\bin\clang++.exe 0x18fc553
#10 0x00007ff694240ef3 C:\Program Files\LLVM\bin\clang++.exe 0x1fc6cdb
C:\Program Files\LLVM\bin\clang++.exe 0x1ee69e8
#11 0x00007ff694240ef3 C:\Program Files\LLVM\bin\clang++.exe 0x1ee6ee5
C:\Program Files\LLVM\bin\clang++.exe 0x1ed48f7
#12 0x00007ff694240ef3 C:\Program Files\LLVM\bin\clang++.exe 0x3c2a C:\Program
Files\LLVM\bin\clang++.exe 0x3b573f0
#13 0x00007ff694240ef3 (C:\Program Files\LLVM\bin\clang++.exe+0x16b0ef3)
#14 0x00007ff6931f8195 (C:\Program Files\LLVM\bin\clang++.exe+0x668195)
0x00007FF694240EF3 (0x0000000000000003 0x0000000000000003 0x0000000000000001
0x0000000000000017)
0x00007FF6931F8195 (0x0000000000000000 0x0000000000000000 0x0000008DA6D8AE28
0x00007FF6944856E3)
0x00007FF6931D6FD0 (0xFFFFFFFFFFFFF000 0x0000026758620106 0x0000008DA6D8AD78
0x0000000000000016)
0x00007FF694E186C1 (0x00000267585E26C0 0x00007FF8CDD12596 0x0000000000000002
0x0000000000000027)
0x00007FF694E0ABB1 (0x00000267580C99A0 0x00000267580C7378 0x000000000000001D
0x00000914DB35FA40)
0x00007FF6931D72A9 (0x0000026758020000 0x0000026757F50000 0x0000026757F502AC
0x00007FF600000000)
0x00007FF693CF23CD (0x0000008DA6D8BBC0 0x00007FF693EFE042 0x00007FF693E56A0C
0x0000008DA6D8BB70)
0x00007FF693EFA4F9 (0x00000914DB35F780 0x0000026758610820 0x0000000000000003
0x00000914DB35F760)
0x00007FF693EFFF93 (0x0000000000000000 0x0000000000000000 0x00000914DB35F700
0x00000267580C7378)
0x00007FF693EFAAE0 (0x0000008DA6D8BDF0 0x0000026700000000 0x00000267585CEDE0
0x0000004100000038)
0x00007FF6946EC8CD (0x0000026758020000 0x00007FF8D08DBA17 0x0000026757F50000
0x0000000000000000)
0x00007FF6966CA8BF (0x0000008DA6D8D578 0x0000008DA6D8D588 0x0000026758048AF0
0x00007FF694BBCAFA)
0x00007FF69579C0B3 (0x0000026758076E60 0x00000914DB359CC0 0x0000000000000000
0x000000000000000F)
0x00007FF694BF8CC2 (0x00000267580CB0C0 0x00007FF600000000 0x00000000000000C8
0x0000002400000000)
0x00007FF694BBFBAC (0x0000008DA6D8D890 0x0000026700000000 0x00000267580CA590
0x00007FF6966E71D3)
0x00007FF694C5E998 (0x00000267580C2DE0 0x0000008DA6D8DA10 0x00000267580C3980
0x00007FF6944981E5)
0x00007FF692B96BE8 (0x0000000000000005 0x000000000000003F 0x0000008DA63A4080
0x0000000000000000)
0x00007FF692B94294 (0x0000000000000120 0x00000267580655C0 0x0000008DA6D8E1C0
0x0000008DA6D8E1A8)
0x00007FF694B574D6 (0x00000267580655C0 0x0000008DA6D8E1A8 0x0000026758048D10
0x0000026758048D10)
0x00007FF69448C553 (0x0000000100000000 0x0000026757F51380 0x000000009D00009D
0x0000026757F50000)
0x00007FF694B56CDB (0x0000026758020000 0x00007FF8D08DBA17 0x0000026757F50000
0x0000008D00000000)
0x00007FF694A769E8 (0x0000000000000000 0x0000000000000000 0x00000267580704B0
0x0000000000000025)
0x00007FF694A76EE5 (0x00007FF69448C880 0x0000026758097C80 0x0000000000000025
0x00007FF894CF2787)
0x00007FF694A648F7 (0x0000000050000151 0x0000000000000000 0x000000008E00008E
0x00000000000006A6)
0x00007FF692B93C2A (0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000)
0x00007FF6966E73F0 (0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000)
0x00007FF8D0447BD4 (0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000), BaseThreadInitThunk() + 0x14 bytes(s)
0x00007FF8D090CED1 (0x0000000000000000 0x0000000000000000 0x0000000000000000
0x0000000000000000), RtlUserThreadStart() + 0x21 bytes(s)
clang++: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 11.0.0
Target: avr
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
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:
C:\Users\hebbeker.ST\AppData\Local\Temp\crc-0435c1.cpp
clang++: note: diagnostic msg:
C:\Users\hebbeker.ST\AppData\Local\Temp\crc-0435c1.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/20201211/8b67416b/attachment.html>


More information about the llvm-bugs mailing list