Date: Fri, 19 Feb 2016 03:21:51 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 207175] projects/clang380-import for TARGET_ARCH=powerpc : clang 3.8.0 sometimes mishandles va_list overflow_arg_area vs. reg_save_area Message-ID: <bug-207175-8-GPdZ0cnIY3@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-207175-8@https.bugs.freebsd.org/bugzilla/> References: <bug-207175-8@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D207175 --- Comment #2 from Mark Millard <markmi@dsl-only.net> --- (In reply to Mark Millard from comment #1) The following has been submitted to llvm 26605. It matches up with the exch= ange on the lists. Roman Divacky (rdivacky at vlakno.cz) came up with the following patch [oth= er than some discussion of what turned into "(8)" in "getIn8(8)" below]. The svnlite diff below is from my testing area for projects/clang380-import in FreeBSD's svn. So the revision number is from there too. Index: /usr/src/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /usr/src/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp=20=20=20= =20=20=20=20 (revision 295601) +++ /usr/src/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp=20=20=20= =20=20=20=20 (working copy) @@ -3569,6 +3569,8 @@ { CGF.EmitBlock(UsingOverflow); + Builder.CreateStore(Builder.getInt8(8), NumRegsAddr); + // Everything in the overflow area is rounded up to a size of at least = 4. CharUnits OverflowAreaAlign =3D CharUnits::fromQuantity(4); The "(8)" is intended to match the "(8)" from: llvm::Value *CC =3D Builder.CreateICmpULT(NumRegs, Builder.getInt8(8), "cond"); My simple test cases and FreeBSD's clang380-import "buildworld" materials (built with the udpate clang 3.8.0) all indicate that this fixes the problem reported. For example each of the following now work based on code generation from the patched clang 3.8.0: la -l -n / svnlite update -295601 /usr/src Both are from using the patched clang 3.8.0 to "buildworld" and then instal= l it and reboot and use the software. The FreeBSD vintage started from is projects/clang380-import -r295601 . I did some testing with doubles in use as a variant of my simplified exampl= e as well in order to test the fpr related handling, not just gpr related. The m= ix worked fine. [Note: I run with the signal delivery modified to have a "red zone" to deal with other aspects of clang 3.8.0 code generation that are currently not ABI compliant for when the stack pointer is moved. Having a "red zone" is still operationally correct for an ABI compliant code generation, it just tempora= rily wastes more bytes. Also: the kernel was built with gcc 4.2.1 but world was built with the patched clang 3.8.0. At this stage I've only been identifying issues with "world" vs. clang 3.8.0. The kernel is a much more involved iss= ue.] --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-207175-8-GPdZ0cnIY3>