Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

[M68k] Code selection failed with string length greater than or equal to 4 #51483

Open Quuxplusone opened 3 years ago

Quuxplusone commented 3 years ago
Bugzilla Link PR52516
Status NEW
Importance P normal
Reported by 0x59616e (t104360003@ntut.org.tw)
Reported on 2021-11-15 23:14:27 -0800
Last modified on 2021-11-15 23:28:18 -0800
Version trunk
Hardware PC Linux
CC glaubitz@physik.fu-berlin.de, llvm-bugs@lists.llvm.org, minyihh@uci.edu
Fixed by commit(s)
Attachments tmp-01b44b.c (111 bytes, text/x-csrc)
tmp-01b44b.sh (1478 bytes, application/x-shellscript)
Blocks
Blocked by
See also

Created attachment 25450 Preprocessed source

This is the code that triggered this error:

void test(char *s) { }

int main() { char s[] = "123"; test(s); return 0; }

This is the error message: $ clang -ccc-gcc-name linux-gnu-gcc --target=m68k tmp.c -o tmp fatal error: error in backend: Cannot select: t47: i32,ch = load<(dereferenceable load (s8) from i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__const.main.s, i32 0, i32 0) + 1), zext from i8> t4, t46, undef:i32 t46: i32 = add nuw t34, Constant:i32<1> t34: i32 = M68kISD::WrapperPC TargetGlobalAddress:i32<[4 x i8] @__const.main.s> 0 t33: i32 = TargetGlobalAddress<[4 x i8] @__const.main.s> 0 t36: i32 = Constant<1> t3: i32 = undef In function: main clang-14: error: clang frontend command failed with exit code 70 (use -v to see invocation) clang version 14.0.0 (https://github.com/llvm/llvm-project.git 7f7cab6bb1d48b53e1fa9ab5a4fd7bcf7f00f19b) Target: m68k Thread model: posix InstalledDir: /home/sheng/project/compiler/llvm_m68k/build/bin clang-14: note: diagnostic msg:


Here's my environment:

$ clang-v clang version 14.0.0 (https://github.com/llvm/llvm-project.git 7f7cab6bb1d48b53e1fa9ab5a4fd7bcf7f00f19b) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /home/sheng/project/compiler/llvm_m68k/build/bin Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9 Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10 Candidate multilib: .;@m64 Selected multilib: .;@m64

Quuxplusone commented 3 years ago

Attached tmp-01b44b.c (111 bytes, text/x-csrc): Preprocessed source

Quuxplusone commented 3 years ago

Attached tmp-01b44b.sh (1478 bytes, application/x-shellscript): Associated run script