Mahadevan R
2008-Jul-10 08:40 UTC
[LLVMdev] r53212 broke LLVM on openbsd-4.3/gcc-3.3.5, patch.
Hi, The custom allocator-related changes committed in rev. 53212 broke LLVM build on openbsd-4.3 with gcc-3.3.5 (i386 and amd64). The attached patch fixes this. This looks like an issue with gcc-3.3.5, and I'm not sure if you guys will be wanting to support this compiler. Just sharing the patch hoping it helps someone. Regards, -Mahadevan. -------------- next part -------------- A non-text attachment was scrubbed... Name: gcc335.patch Type: application/octet-stream Size: 686 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080710/91217cca/attachment.obj>
Laurence Tratt
2008-Jul-22 18:14 UTC
[LLVMdev] r53212 broke LLVM on openbsd-4.3/gcc-3.3.5, patch.
On Thu, Jul 10, 2008 at 02:10:18PM +0530, Mahadevan R wrote: I was just wondering if anyone had been able to look at Mahadevan's patch? It makes LLVM compile again on OpenBSD with gcc 3, and doesn't seem to cause any regressions. It would definitely make some of our lives easier if this was in SVN rather than having to be applied manually each time :)> The custom allocator-related changes committed in rev. 53212 broke LLVM > build on openbsd-4.3 with gcc-3.3.5 (i386 and amd64). The attached patch > fixes this. > > This looks like an issue with gcc-3.3.5, and I'm not sure if you guys will > be wanting to support this compiler. Just sharing the patch hoping it helps > someone.Laurie -- http://tratt.net/laurie/ -- Personal http://convergepl.org/ -- The Converge programming language -------------- next part -------------- Index: include/llvm/CodeGen/MachineFunction.h ==================================================================--- include/llvm/CodeGen/MachineFunction.h (revision 53390) +++ include/llvm/CodeGen/MachineFunction.h (working copy) @@ -136,7 +136,11 @@ /// template<typename Ty> Ty *getInfo() { - if (!MFInfo) MFInfo = new (Allocator.Allocate<Ty>()) Ty(*this); + if (!MFInfo) { + Ty *loc = static_cast<Ty*>(Allocator.Allocate( + sizeof(Ty),AlignOf<Ty>::Alignment)); + MFInfo = new (loc) Ty(*this); + } assert((void*)dynamic_cast<Ty*>(MFInfo) == (void*)MFInfo && "Invalid concrete type or multiple inheritence for getInfo");
Dan Gohman
2008-Jul-25 00:40 UTC
[LLVMdev] r53212 broke LLVM on openbsd-4.3/gcc-3.3.5, patch.
Hello, I just applied (a slightly edited form of) this patch. Dan On Jul 22, 2008, at 11:14 AM, Laurence Tratt wrote:> On Thu, Jul 10, 2008 at 02:10:18PM +0530, Mahadevan R wrote: > > I was just wondering if anyone had been able to look at Mahadevan's > patch? > It makes LLVM compile again on OpenBSD with gcc 3, and doesn't seem > to cause > any regressions. It would definitely make some of our lives easier > if this > was in SVN rather than having to be applied manually each time :) > >> The custom allocator-related changes committed in rev. 53212 broke >> LLVM >> build on openbsd-4.3 with gcc-3.3.5 (i386 and amd64). The attached >> patch >> fixes this. >> >> This looks like an issue with gcc-3.3.5, and I'm not sure if you >> guys will >> be wanting to support this compiler. Just sharing the patch hoping >> it helps >> someone. > > > Laurie > -- > http://tratt.net/laurie/ -- Personal > http://convergepl.org/ -- The Converge programming language > <gcc335.patch>_______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev