-
Notifications
You must be signed in to change notification settings - Fork 15.6k
Closed
Closed
Copy link
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]good first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute
Description
$ clang 1.c
fatal error: error in backend: Cannot select: 0x55ae0ee38910: i64 = bitcast 0x55ae0ee387c0
0x55ae0ee387c0: i32,ch = load<(dereferenceable load (s32) from %ir.2)> 0x55ae0ee38750, FrameIndex:i64<0>, undef:i64
0x55ae0ee384b0: i64 = FrameIndex<0>
0x55ae0ee38590: i64 = undef
In function: foo
clang-16: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 16.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin
clang-16: note: diagnostic msg:
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-16: note: diagnostic msg: /tmp/1-348f26.c
clang-16: note: diagnostic msg: /tmp/1-348f26.sh
clang-16: note: diagnostic msg:
$ cat /tmp/1-41ff31.c
# 1 "<built-in>"
# 1 "1.c"
void foo(int arg)
{
int x = 0;
unsigned char *y = __builtin_assume_aligned(arg, 16);
for (int i = 0; i < 8; ++i)
x = y[i];
return;
}
$ cat /tmp/1-41ff31.sh
# Crash reproducer for clang version 16.0.0
# Driver args: "1.c"
# Original command: "clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "1.c" "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie" "-mframe-pointer=all" "-fmath-errno" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-funwind-tables=2" "-target-cpu" "x86-64" "-tune-cpu" "generic" "-mllvm" "-treat-scalable-fixed-error-as-warning" "-debugger-tuning=gdb" "-fcoverage-compilation-dir=/home/xxx/llvm-test" "-resource-dir" "clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16" "-internal-isystem" "clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/include" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include" "-internal-externc-isystem" "/usr/include/x86_64-linux-gnu" "-internal-externc-isystem" "/include" "-internal-externc-isystem" "/usr/include" "-fdebug-compilation-dir=/home/xxx/llvm-test" "-ferror-limit" "19" "-fgnuc-version=4.2.1" "-fcolor-diagnostics" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o" "/tmp/1-eabb2d.o" "-x" "c" "1.c"
"clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/bin/clang-16" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "1.c" "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie" "-mframe-pointer=all" "-fmath-errno" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-funwind-tables=2" "-target-cpu" "x86-64" "-tune-cpu" "generic" "-mllvm" "-treat-scalable-fixed-error-as-warning" "-debugger-tuning=gdb" "-fcoverage-compilation-dir=/home/xxx/llvm-test" "-fdebug-compilation-dir=/home/xxx/llvm-test" "-ferror-limit" "19" "-fgnuc-version=4.2.1" "-fcolor-diagnostics" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-x" "c" "1-41ff31.c"
$ clang --version
clang version 16.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /path-to/clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/binThis is a regression bug, Clang 14.0.6 is not affected.
Metadata
Metadata
Assignees
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"crashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]good first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute