[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#988965: llvm-toolchain-12: llvm 12 generates bad human-readable IR output on mipsel



Control: tags -1 + patch upstream

Hi, I have tested https://github.com/llvm/llvm-project/commit/ab40c027f0ce9492919a72ad339de40bdb84b354 on eller.debian.org and I can confirm this fixes the problem.

Please backport it onto the next version of the package. The patch should apply cleanly directly.

Best,
Ximin

Ximin Luo:
> Source: llvm-toolchain-12
> Version: 1:12.0.0-3
> Severity: important
> X-Debbugs-Cc: debian-mips@lists.debian.org, debian-rust@lists.debian.org
> 
> Dear Maintainer,
> 
> LLVM 12's ability to emit IR in human-readable form is corrupted on mipsel 32-bit:
> 
> $ cat main.c 
> #include <string.h>
> 
> int main() {
>   char *a = NULL;
>   char *b = NULL;
>   memcpy(a, b, 0);
> }
> $ clang-12 -S -emit-llvm main.c
> $ grep 00G8 main.ll
>   call void @llvm.memcpy.00G8.00G8.G32(i8* align 1 %3, i8* align 1 %4, i32 0, i1 false)
> declare void @llvm.memcpy.00G8.00G8.G32(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i32, i1 immarg) #1
> 
> 00G8 is not correct, it should be p0i8 and suggests miscompilation somewhere as
> the source code of the function does not contain these characters:
> 
> https://github.com/llvm/llvm-project/blob/5b6cae5524905bc43cfc21a515f828528d1f2e68/llvm/lib/IR/Function.cpp#L777
> 
> This additionally makes some rustc tests fail.
> 
> LLVM 11 is fine.
> 
> I filed a Debian bug for now because I could not find any other LLVM 12 mipsel
> binaries to test with online; neither upstream nor Fedora distribute these.
> Please do forward upstream if you are confident this is not a Debian-specific
> issue.
> 
> X
> 
> -- System Information:
> Debian Release: 11.0
>   APT prefers testing
>   APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 'testing-security'), (500, 'testing-debug'), (500, 'stable'), (300, 'unstable'), (100, 'experimental'), (1, 'experimental-debug')
> Architecture: amd64 (x86_64)
> Foreign Architectures: i386
> 
> Kernel: Linux 5.9.0-4-amd64 (SMP w/4 CPU threads)
> Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en
> Shell: /bin/sh linked to /bin/dash
> Init: systemd (via /run/systemd/system)
> LSM: AppArmor: enabled
> 


-- 
GPG: ed25519/56034877E1F87C35
https://github.com/infinity0/pubkeys.git


Reply to: