-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Description
Using llvm 15.0.2 (or 14.0.6) compiling code that uses 128 bit integers (with either -fforce-enable-int128 or using MODE TI types) and targeting Cortex-M55 or Cortex-M85 crashes with an Optimizer error at -O2 and -O3 and -Oz optimization levels.
Example reduced from compiler-rt lib/builtins/addvti3.c (which is normally skipped as CRT_HAS_128BIT is not defined)
clang --save-temps -fomit-frame-pointer --target=arm-none-eabi -mcpu=cortex-m55 -c -O3 addvti3-reduced.c
'''clang --save-temps -fomit-frame-pointer --target=arm-none-eabi -mcpu=cortex-m55 -c -O3 addvti3-reduced.c
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: c:\LLVM15\bin\clang.exe -cc1 -triple thumbv8.1m.main-none-unknown-eabi -S -save-temps=cwd -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name addvti3-reduced.c -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -fno-verbose-asm -mconstructor-aliases -nostdsysteminc -target-cpu cortex-m55 -target-feature +soft-float-abi -target-feature -crc -target-feature -dotprod -target-feature +dsp -target-feature +mve -target-feature +mve.fp -target-feature +ras -target-feature -fp16fml -target-feature -bf16 -target-feature -sb -target-feature -i8mm -target-feature +lob -target-feature -cdecp0 -target-feature -cdecp1 -target-feature -cdecp2 -target-feature -cdecp3 -target-feature -cdecp4 -target-feature -cdecp5 -target-feature -cdecp6 -target-feature -cdecp7 -target-feature -pacbti -target-feature -hwdiv-arm -target-feature +hwdiv -target-feature +vfp2 -target-feature +vfp2sp -target-feature -vfp3 -target-feature +vfp3d16 -target-feature +vfp3d16sp -target-feature -vfp3sp -target-feature +fp16 -target-feature -vfp4 -target-feature +vfp4d16 -target-feature +vfp4d16sp -target-feature -vfp4sp -target-feature -fp-armv8 -target-feature +fp-armv8d16 -target-feature +fp-armv8d16sp -target-feature -fp-armv8sp -target-feature +fullfp16 -target-feature +fp64 -target-feature -d32 -target-feature -neon -target-feature -crypto -target-feature -sha2 -target-feature -aes -target-feature +strict-align -target-abi aapcs -mfloat-abi soft -Wunaligned-access -fallow-half-arguments-and-returns -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=gdb -fcoverage-compilation-dir=C:\work\b-addvti3_m55_crash -resource-dir c:\LLVM15\lib\clang\15.0.2 -O3 -fdebug-compilation-dir=C:\work\b-addvti3_m55_crash -ferror-limit 19 -fmessage-length=120 -fno-signed-char -fgnuc-version=4.2.1 -fcolor-diagnostics -vectorize-loops -vectorize-slp -faddrsig -o addvti3-reduced.s -x ir addvti3-reduced.bc
- Optimizer
Exception Code: 0xC0000005
#0 0x00007ff715652532 (c:\LLVM15\bin\clang.exe+0x32532)
#1 0x00007ff7163e1336 (c:\LLVM15\bin\clang.exe+0xdc1336)
#2 0x00007ff7156f2ef0 (c:\LLVM15\bin\clang.exe+0xd2ef0)
#3 0x00007ff71604c1ca (c:\LLVM15\bin\clang.exe+0xa2c1ca)
#4 0x00007ff715d465a1 (c:\LLVM15\bin\clang.exe+0x7265a1)
#5 0x00007ff715d4cb29 (c:\LLVM15\bin\clang.exe+0x72cb29)
#6 0x00007ff715d5fde2 (c:\LLVM15\bin\clang.exe+0x73fde2)
#7 0x00007ff715d83b7c (c:\LLVM15\bin\clang.exe+0x763b7c)
#8 0x00007ff715d64641 (c:\LLVM15\bin\clang.exe+0x744641)
#9 0x00007ff715d64305 (c:\LLVM15\bin\clang.exe+0x744305)
#10 0x00007ff715d5d120 (c:\LLVM15\bin\clang.exe+0x73d120)
#11 0x00007ff715d5b709 (c:\LLVM15\bin\clang.exe+0x73b709)
#12 0x00007ff715d5b0a2 (c:\LLVM15\bin\clang.exe+0x73b0a2)
#13 0x00007ff718054881 (c:\LLVM15\bin\clang.exe+0x2a34881)
#14 0x00007ff7162a3485 (c:\LLVM15\bin\clang.exe+0xc83485)
#15 0x00007ff7156a4191 (c:\LLVM15\bin\clang.exe+0x84191)
#16 0x00007ff7162a5b51 (c:\LLVM15\bin\clang.exe+0xc85b51)
#17 0x00007ff7156a3f91 (c:\LLVM15\bin\clang.exe+0x83f91)
#18 0x00007ff7162a21f7 (c:\LLVM15\bin\clang.exe+0xc821f7)
#19 0x00007ff716d75dcf (c:\LLVM15\bin\clang.exe+0x1755dcf)
#20 0x00007ff716d6f491 (c:\LLVM15\bin\clang.exe+0x174f491)
#21 0x00007ff7170f8dc4 (c:\LLVM15\bin\clang.exe+0x1ad8dc4)
#22 0x00007ff717065bc2 (c:\LLVM15\bin\clang.exe+0x1a45bc2)
#23 0x00007ff715df552d (c:\LLVM15\bin\clang.exe+0x7d552d)
#24 0x00007ff715e86bbe (c:\LLVM15\bin\clang.exe+0x866bbe)
#25 0x00007ff715627b1b (c:\LLVM15\bin\clang.exe+0x7b1b)
#26 0x00007ff715624a73 (c:\LLVM15\bin\clang.exe+0x4a73)
#27 0x00007ff71562480f (c:\LLVM15\bin\clang.exe+0x480f)
#28 0x00007ff719808640 (c:\LLVM15\bin\clang.exe+0x41e8640)
#29 0x00007ffdb52c7034 (C:\WINDOWS\System32\KERNEL32.DLL+0x17034)
#30 0x00007ffdb70a26a1 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x526a1)
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 15.0.2
Target: arm-none-unknown-eabi
Thread model: posix
InstalledDir: c:\LLVM15\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\dearlam\AppData\Local\Temp\addvti3-reduced-f8104e.c
clang: note: diagnostic msg: C:\Users\dearlam\AppData\Local\Temp\addvti3-reduced-f8104e.sh
clang: note: diagnostic msg:
********************'''
Compiles fine for Cortex-M4 and x86_64-pc.
addvti3-reduced.c :
typedef int ti_int __attribute__((mode(TI)));
typedef unsigned tu_int __attribute__((mode(TI)));
#define compilerrt_abort() __compilerrt_abort_impl(__FILE__, __LINE__, __func__)
void __compilerrt_abort_impl(const char *file, int line,
const char *function);
ti_int __addvti3(ti_int a, ti_int b) {
ti_int s = (tu_int)a + (tu_int)b;
if (b >= 0) {
if (s < a)
compilerrt_abort();
} else {
if (s >= a)
compilerrt_abort();
}
return s;
}
WORKAROUND
Disable superword-level parallelism using
-fno-slp-vectorize
Metadata
Metadata
Assignees
Type
Projects
Status