clang-cl crash on simple inline asm example

found while compiling dosbox (DOS Emulator) with clang-cl, reduced code
in crash.cpp,
works with VS2017+19, clang.exe crashes also

Clang-CL Version: from http://llvm.org/builds/, Windows installer
(64-bit), based on Git commit e20a1e486e1 (27 November 2019).

cmd: clang-cl.exe crash.cpp

[crash.cpp]
int main()
{
__asm {
push offset(return_address)
return_address:
}
return 0;
}

[stderror output in stderr.txt]
crash.cpp(4,20): error: expected unqualified-id
push offset(return_address)
^
Assertion failed: Loc >= AsmStart && "Expected Loc to be at or after
Start!", file
C:\src\llvm_package_e20a1e486e1\llvm-project\llvm\lib\MC\MCParser\AsmParser.cpp,
line 5893
Stack dump:
0. Program arguments: c:\Program Files\LLVM\bin\clang-cl.exe -cc1
-triple x86_64-pc-windows-msvc19.16.27034 -emit-obj -mrelax-all
-mincremental-linker-compatible -disable-free -main-file-name crash.cpp
-mrelocation-model pic -pic-level 2 -mthread-model posix
-mframe-pointer=none -relaxed-aliasing -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -mllvm
-x86-asm-syntax=intel -D_MT -flto-visibility-public-std
--dependent-lib=libcmt --dependent-lib=oldnames -stack-protector 2
-fms-volatile -fdiagnostics-format msvc -dwarf-column-info -resource-dir
c:\Program Files\LLVM\lib\clang\10.0.0 -internal-isystem c:\Program
Files\LLVM\lib\clang\10.0.0\include -internal-isystem C:\Program Files
(x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include
-internal-isystem C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\VC\Tools\MSVC\14.16.27023\atlmfc\include
-internal-isystem C:\Program Files (x86)\Windows
Kits\10\Include\10.0.17763.0\ucrt -internal-isystem C:\Program Files
(x86)\Windows Kits\10\include\10.0.17763.0\shared -internal-isystem
C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um
-internal-isystem C:\Program Files (x86)\Windows
Kits\10\include\10.0.17763.0\winrt -fdeprecated-macro
-fdebug-compilation-dir D:\temp\clang-cl-crash -ferror-limit 19
-fmessage-length 0 -fno-use-cxa-atexit -fms-extensions
-fms-compatibility -fms-compatibility-version=19.16.27034 -std=c++14
-fdelayed-template-parsing -fobjc-runtime=gcc -fdiagnostics-show-option
-faddrsig -o C:\Users\dl\AppData\Local\Temp\crash-d293f9.obj -x c++
crash.cpp
1. crash.cpp:7:5: current parser token 'return'
2. crash.cpp:2:1: parsing function body 'main'
3. crash.cpp:2:1: in compound statement ('{}')
#0 0x000000014144f8a6 c:\Program Files\LLVM\bin\clang-cl.exe 0x1edf8a6
c:\Program Files\LLVM\bin\ucrtbase.DLL 0x6a9ff
#1 0x000000014144f8a6 c:\Program Files\LLVM\bin\ucrtbase.DLL 0x6b6f1
c:\Program Files\LLVM\bin\ucrtbase.DLL 0x6d3a5
#2 0x000000014144f8a6 c:\Program Files\LLVM\bin\ucrtbase.DLL 0x6d68f
c:\Program Files\LLVM\bin\clang-cl.exe 0x1c6611a
#3 0x000000014144f8a6 c:\Program Files\LLVM\bin\clang-cl.exe 0x35e88d5
c:\Program Files\LLVM\bin\clang-cl.exe 0x35eac19
#4 0x000000014144f8a6 c:\Program Files\LLVM\bin\clang-cl.exe 0x35aed24
c:\Program Files\LLVM\bin\clang-cl.exe 0x35ad77f
#5 0x000000014144f8a6 c:\Program Files\LLVM\bin\clang-cl.exe 0x35b7437
c:\Program Files\LLVM\bin\clang-cl.exe 0x35b81a4
#6 0x000000014144f8a6 c:\Program Files\LLVM\bin\clang-cl.exe 0x35202ea
c:\Program Files\LLVM\bin\clang-cl.exe 0x356ff23
#7 0x000000014144f8a6 c:\Program Files\LLVM\bin\clang-cl.exe 0x351f390
c:\Program Files\LLVM\bin\clang-cl.exe 0x351ec3c
#8 0x000000014144f8a6 c:\Program Files\LLVM\bin\clang-cl.exe 0x351d7d2
c:\Program Files\LLVM\bin\clang-cl.exe 0x351b733
#9 0x000000014144f8a6 c:\Program Files\LLVM\bin\clang-cl.exe 0x351afd3
c:\Program Files\LLVM\bin\clang-cl.exe 0x35172e2
#10 0x000000014144f8a6 c:\Program Files\LLVM\bin\clang-cl.exe 0x26fe325
c:\Program Files\LLVM\bin\clang-cl.exe 0x26b7dab
#11 0x000000014144f8a6 c:\Program Files\LLVM\bin\clang-cl.exe 0x27666a9
c:\Program Files\LLVM\bin\clang-cl.exe 0x76e5
#12 0x000000014144f8a6 c:\Program Files\LLVM\bin\clang-cl.exe 0x46d5
c:\Program Files\LLVM\bin\clang-cl.exe 0x4598a90
#13 0x000000014144f8a6 (c:\Program Files\LLVM\bin\clang-cl.exe+0x1edf8a6)
#14 0x000007fee74ca9ff (c:\Program Files\LLVM\bin\ucrtbase.DLL+0x6a9ff)
0x000000014144F8A6 (0x0000000000000016 0x000007FEE7478741
0x0000000000B2ABA0 0x000007FEE7545510)
0x000007FEE74CA9FF (0x0000000000001701 0x0000000100000000
0x0000000000001705 0x0000000144F620F6), raise() + 0x1CF bytes(s)
0x000007FEE74CB6F1 (0x000007FE00000003 0x000007FE00000003
0x0000000144F620F6 0x0000000144F5FCD6), abort() + 0x31 bytes(s)
0x000007FEE74CD3A5 (0x0000000000001705 0x0000000144F620F6
0x0000000143B0D570 0x0000000000B2ACF8), _get_wpgmptr() + 0x1BF5 bytes(s)
0x000007FEE74CD68F (0xFFFFFFFFFFFFFFFF 0x0000000000B2BBD4
0x0000000000000006 0x0000000000000004), _wassert() + 0x3F bytes(s)
0x00000001411D611A (0x000000000263F600 0x0000000000000000
0x0000000000000021 0x0000000000000000)
0x0000000142B588D5 (0xFFFFFFFFFFFFFFFF 0x0000000000000000
0x000000000268DBD3 0x0000000000000005)
0x0000000142B5AC19 (0x00000000026A5D78 0x0000000000000006
0x0000000000000000 0x00000000026A7C20)
0x0000000142B1ED24 (0x0000000000B2C898 0x0000000102000002
0x0000000000000000 0x0000242C883536F6)
0x0000000142B1D77F (0x0000000002697F00 0x0000000002697F10
0x0000000000000140 0x0000000002697F10)
0x0000000142B27437 (0x00000000026A7C70 0x0000000000000000
0x0000000000000000 0x0000000000B2CDD8)
0x0000000142B281A4 (0x0000000000000000 0x00000000000000BD
0x0000000000200000 0x0000000000B2CA90)
0x0000000142A902EA (0x0000000000BB5C30 0x0000000000B2CC70
0x0000000000B2CC60 0x00000000000000A0)
0x0000000142ADFF23 (0x0000000000000000 0x00000001438BE3CB
0x0000000000C76198 0x0000242C88352400)
0x0000000142A8F390 (0x0000000002692100 0x000000000268DBC0
0x0000000000000003 0x0000002000000000)
0x0000000142A8EC3C (0x0000000000000000 0x0000000000C6EF48
0x0000242C88352B06 0x00000001438756C4)
0x0000000142A8D7D2 (0x0000000000000000 0x0000000000000000
0x0000000000C6EB90 0x0000000000C6C520)
0x0000000142A8B733 (0x0000000000000001 0x00000001451DB05B
0x0000000000000005 0x0000242C88352916)
0x0000000142A8AFD3 (0x0000000000000000 0x0000000141C2486F
0x000000000000000E 0x0000000000000015)
0x0000000142A872E2 (0x0000000100000010 0x0000242C88352B06
0x0000000000000000 0x000000000000000F)
0x0000000141C6E325 (0x0000000000C312B0 0x0000000143B08873
0x00000000000000C8 0x0000000000B2DEC0)
0x0000000141C27DAB (0x0000000000C32D01 0x0000000000000000
0x0000000000C0EF01 0x0000000000000000)
0x0000000141CD66A9 (0x0000000000BB0158 0x0000000000C3DE50
0x0000000000000010 0x0000000000BB5C30)
0x000000013F5776E5 (0x0000000002000002 0x0000000076CF7B9C
0x0000000000BB0000 0x0061000000000002)
0x000000013F5746D5 (0x0000000000000000 0x0000000000000000
0x01D5A74FAA298CD5 0x01D5A74FAA299249)
0x0000000143B08A90 (0x0000000000000000 0x0000000000000000
0x0000000000000000 0x0000000000000000)
0x0000000076AC556D (0x0000000000000000 0x0000000000000000
0x0000000000000000 0x0000000000000000), BaseThreadInitThunk() + 0xD bytes(s)
0x0000000076D2372D (0x0000000000000000 0x0000000000000000
0x0000000000000000 0x0000000000000000), RtlUserThreadStart() + 0x1D bytes(s)
clang-cl: error: clang frontend command failed due to signal (use -v to
see invocation)
clang version 10.0.0
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: c:\Program Files\LLVM\bin
clang-cl: 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-cl: note: diagnostic msg:

crash.cpp (107 Bytes)

crash-43a7ee.cpp (140 Bytes)

crash-43a7ee.sh (2.78 KB)

stderr.txt (7.31 KB)