<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>From the <a href="http://llvm.org/docs/DeveloperPolicy.html" target="_blank" style="font-size: 15px; line-height: 21px; color: rgb(0, 104, 207); cursor: pointer;">DeveloperPolicy.html</a> document I gathered I need to send a patch to this list (which I did); could you clarify if I misunderstood it?<div><br></div><div>The second patch is really trivial and I think it's worth applying - it seems like a typo by someone who tested on MSVC 11 but not 10; or maybe my local instance of MSVC10 is somehow deficient, of course.</div><div><br></div><div>The first patch is adding MSVC-specific __declspec(noinline) - that's the whole patch - so if someone experienced who has access to all the platforms LLVM compiles on could test it (and/or replace it with something cross-platform; or #ifdef it out everywhere non-MS), I think that would be worth applying to the trunk. I don't have those resources.<br><div><br></div><div><div>The cause of ICE is pretty much right here - inlining utostr crashes MSVC cl.exe. I read about it a few months ago elsewhere and I think the bug was filed with MS (I'm not positive and I have no idea how/where to check it). I don't think I can find much more precise cause within reasonable time, ICE doesn't reproduce in simple cases and I'm not committed enough to do a lengthy binary search of the combination of factors that causes this particular ICE when I only have a lukewarm hope MS would ever give this bug a look. </div><div><br></div><div>Either way, I thought I'd try to push this through. It's not high-value enough to try harder, but it'd be great if someone could help me submit it - it's a <i>really </i>simple couple of patches that make LLVM/clang compile on MSVC10 without further modifications.</div><div><br></div><div>Regards,</div><div>Sergiy</div><div><br><br><div><div id="SkyDrivePlaceholder"></div>> Date: Wed, 17 Apr 2013 21:56:43 -0700<br>> Subject: Re: [LLVMdev] Patch to compile LLVM with MSVC 2010<br>> From: dblaikie@gmail.com<br>> To: migdalskiy@hotmail.com<br>> CC: llvmdev@cs.uiuc.edu<br>> <br>> On Wed, Apr 17, 2013 at 11:36 AM, Sergiy Migdalskiy<br>> <migdalskiy@hotmail.com> wrote:<br>> > In order to get llvm to compile on Windows with MSVC 10, I have to disable<br>> > inline on utostr to avoid internal compiler failure, and disable _xgetbv<br>> > call in OsSupportsAVX because it's only defined in MSVC 2012 compiler. The<br>> > first patch (noinline) is known for many months now. I'm a casual llvm user,<br>> > and don't know the proper channels to go through to submit a patch. Could<br>> > someone tell me, where do I submit patches like this one below?<br>> <br>> http://llvm.org/docs/DeveloperPolicy.html<br>> <br>> > Or maybe why<br>> > I shouldn't try to do it.<br>> <br>> We're generally happy to apply patches to ensure LLVM compiles on<br>> relevant compilers. For ICEs it might help to know what the precise<br>> problem is & to have a bug filed on the compiler.<br>> <br>> ><br>> > Sincerely,<br>> > Sergiy<br>> ><br>> > Index: include/llvm/ADT/StringExtras.h<br>> > ===================================================================<br>> > --- include/llvm/ADT/StringExtras.h (revision 179701)<br>> > +++ include/llvm/ADT/StringExtras.h (working copy)<br>> > @@ -84,7 +84,7 @@<br>> >    return std::string(BufPtr, Buffer+11);<br>> >  }<br>> ><br>> > -static inline std::string utostr(uint64_t X, bool isNeg = false) {<br>> > +static __declspec(noinline) inline std::string utostr(uint64_t X, bool<br>> > isNeg = false) {<br>> >    char Buffer[21];<br>> >    char *BufPtr = Buffer+21;<br>> ><br>> > Index: lib/Support/Host.cpp<br>> > ===================================================================<br>> > --- lib/Support/Host.cpp (revision 179701)<br>> > +++ lib/Support/Host.cpp (working copy)<br>> > @@ -119,7 +119,7 @@<br>> >    // there is no easy way to conditionally compile based on the assembler<br>> > used.<br>> >    int rEAX, rEDX;<br>> >    __asm__ (".byte 0x0f, 0x01, 0xd0" : "=a" (rEAX), "=d" (rEDX) : "c" (0));<br>> > -#elif defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 160040219<br>> > +#elif defined(_MSC_FULL_VER) && _MSC_FULL_VER > 160040219<br>> >    unsigned long long rEAX = _xgetbv(_XCR_XFEATURE_ENABLED_MASK);<br>> >  #else<br>> >    int rEAX = 0; // Ensures we return false<br>> ><br>> ><br>> > _______________________________________________<br>> > LLVM Developers mailing list<br>> > LLVMdev@cs.uiuc.edu         http://llvm.cs.uiuc.edu<br>> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev<br>> ><br></div></div></div></div>                                    </div></body>
</html>