<div class="gmail_quote">On Tue Jan 20 2015 at 6:58:52 PM Duncan P. N. Exon Smith <<a href="mailto:dexonsmith@apple.com">dexonsmith@apple.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> On 2015 Jan 20, at 07:53, Timur Iskhodzhanov <<a href="mailto:timurrrr@google.com" target="_blank" class="cremed">timurrrr@google.com</a>> wrote:<br>
><br>
> This is what I get on my Windows machine:<br>
>   $ cat test.cpp<br>
>   char hello;<br>
>   $ bin\clang.exe -cc1 -gline-tables-only -triple i686-pc-linux -emit-obj -o z test.cpp<br>
>   Assertion failed: DbgNode->isTemporary() && "Expected temporary node", file ..\lib\IR\DebugInfo.cpp, line 350<br>
> but on Linux it's fine.<br>
><br>
> Replacing<br>
>   StorageType Storage : 2;<br>
> with<br>
>   unsigned Storage : 2;<br>
> seems to resolve the issue.<br>
> Shall I commit this change?<br>
><br>
<br>
Thanks for tracking this down!<br></blockquote><div><br></div><div>You've just won a black belt in remote debugging :)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I guessed at the same thing and got someone on IRC to confirm.  Already<br>
committed in r226570.<br></blockquote><div><br></div><div>Thanks, the Chromium bots are cycling green now! </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> Reid might know the enum stuff better.<br>
<br>
It's not an enum problem, as it turns out.  Same difference in behaviour<br>
would happen with `int Storage : 2`.<br>
<br>
MSVC makes the top bit of the bitfield the sign bit; other compilers<br>
"chop off" the sign bit.  It's implementation-defined which behaviour<br>
you get (so MSVC isn't actually wrong here, just annoyingly different).<br>
<br>
I should have remembered this :/.  Sorry for the trouble.<br></blockquote><div><br></div><div>Do you think we could somehow find such bugs automatically?</div><div>And/or update the developer policy?</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> On Tue Jan 20 2015 at 6:39:22 PM Duncan P. N. Exon Smith <<a href="mailto:dexonsmith@apple.com" target="_blank" class="cremed">dexonsmith@apple.com</a>> wrote:<br>
><br>
> > On 2015 Jan 20, at 07:32, Timur Iskhodzhanov <<a href="mailto:timurrrr@google.com" target="_blank" class="cremed">timurrrr@google.com</a>> wrote:<br>
> ><br>
> ><br>
> ><br>
> > On Tue Jan 20 2015 at 6:20:34 PM Duncan Exon Smith <<a href="mailto:dexonsmith@apple.com" target="_blank" class="cremed">dexonsmith@apple.com</a>> wrote:<br>
> ><br>
> ><br>
> > On Jan 20, 2015, at 3:48 AM, Timur Iskhodzhanov <<a href="mailto:timurrrr@google.com" target="_blank" class="cremed">timurrrr@google.com</a>> wrote:<br>
> ><br>
> >> Hi Duncan,<br>
> >><br>
> >> This has broken down "ninja check-asan" on 32-bit Windows.<br>
> >> Assertion failed: Context.hasReplaceableUses() && "Expected RAUW support", file C:\src\llvm_bot\slave\win\<u></u>build\llvm\include\llvm/IR/<u></u>Metadata.h, line 976<br>
> ><br>
> > Can you include the asan output?   A backtrace?   Point at a buildbot?   I don't have the tools to reproduce this.<br>
> ><br>
> > There's no public buildbot for ASan itself, but turns out this problem is not even specific to ASan.<br>
> ><br>
> > This public bot just builds Chromium with Clang<br>
> > <a href="http://build.chromium.org/p/chromium.fyi/builders/CrWinClang/builds/1295/steps/compile/logs/stdio" target="_blank" class="cremed">http://build.chromium.org/p/<u></u>chromium.fyi/builders/<u></u>CrWinClang/builds/1295/steps/<u></u>compile/logs/stdio</a><br>
> ><br>
> > Assertion failed: isTemporary() && "Expected temporary node", file C:\b\build\slave\CrWinClang\<u></u>build\src\third_party\llvm\<u></u>include\llvm/IR/Metadata.h, line 741<br>
> > since r226499.<br>
> ><br>
> > OK, I'll try to minimize...<br>
> > (I suppose the change looks sane at the first glance and you can't come up with a repro yourself)<br>
> ><br>
> > It seems to be hard to revert now...<br>
> >> You've committed a lot of small changes in a very short timeframe -<br>
> ><br>
> > Actually, I committed work over the span of an entire work day.<br>
> ><br>
> > Oh, I see.<br>
> >> - I assume you're using git?  Is there a reason why you don't squash your changes before committing?  It makes finding bad commits / reverting harder...<br>
> ><br>
> > Besides being developer policy to separate changes as much as possible, it also makes changes easier to review, and isolating which change causes a problem easier to determine.<br>
> ><br>
> > Unless it results in complex history and back-in-forth changes, I suppose.<br>
> > I've spent more than an hour today trying to locally bisect and revert the changes and ended up just locally reverting 40+ of your commits after 226490 to make progress.  Unfortunately, reverting just r226490 results in a waterfall of merge conflicts.<br>
><br>
> Yup, all the others depend on it.  I would have dealt with it myself<br>
> if a buildbot had told me about it.<br>
><br>
> > Do you think it's reasonable to temporarily revert your changes in the [r226490, HEAD] range to unbreak stuff?<br>
> > I have a patch ready for that.<br>
><br>
> Certainly an option, although I'm actively looking at this right now<br>
> (sorry for the delay, I'm in PDT so I just woke up).<br>
><br>
> Did you do a full bisect?  Are you sure that leaving this in and<br>
> reverting the ones that follow don't also fix it?<br>
><br>
> Do you know if MSVC handles things like:<br>
><br>
>     enum StorageType { ... };<br>
>     StorageType Storage : 2;<br>
><br>
> correctly (well, the way I expect), or should I store it as an<br>
><br>
>     unsigned Storage : 2;<br>
><br>
> for compatibility?  Any chance it causes a weird layout problem that<br>
> this commit happens to point out?<br>
><br>
> (Given that this is MSVC-only, I suspect there's a layout problem or<br>
> UB somewhere.)<br>
><br>
> >> On Mon Jan 19 2015 at 10:30:36 PM Duncan P. N. Exon Smith <<a href="mailto:dexonsmith@apple.com" target="_blank" class="cremed">dexonsmith@apple.com</a>> wrote:<br>
> >> Author: dexonsmith<br>
> >> Date: Mon Jan 19 13:26:24 2015<br>
> >> New Revision: 226490<br>
> >><br>
> >> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=226490&view=rev" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project?rev=226490&view=rev</a><br>
> >> Log:<br>
> >> IR: Remove direct comparisons against Metadata::Storage, NFC<br>
> >><br>
> >> Modified:<br>
> >>     llvm/trunk/lib/IR/Metadata.cpp<br>
> >><br>
> >> Modified: llvm/trunk/lib/IR/Metadata.cpp<br>
> >> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Metadata.cpp?rev=226490&r1=226489&r2=226490&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/lib/IR/<u></u>Metadata.cpp?rev=226490&r1=<u></u>226489&r2=226490&view=diff</a><br>
> >> ==============================<u></u>==============================<u></u>==================<br>
> >> --- llvm/trunk/lib/IR/Metadata.cpp (original)<br>
> >> +++ llvm/trunk/lib/IR/Metadata.cpp Mon Jan 19 13:26:24 2015<br>
> >> @@ -402,7 +402,7 @@ MDNode::MDNode(LLVMContext &Context, uns<br>
> >>    for (unsigned I = 0, E = MDs.size(); I != E; ++I)<br>
> >>      setOperand(I, MDs[I]);<br>
> >><br>
> >> -  if (Storage == Temporary)<br>
> >> +  if (isTemporary())<br>
> >>      this->Context.makeReplaceable(<br>
> >>          make_unique<<u></u>ReplaceableMetadataImpl>(<u></u>Context));<br>
> >>  }<br>
> >> @@ -416,7 +416,7 @@ static bool isOperandUnresolved(Metadata<br>
> >>  UniquableMDNode::<u></u>UniquableMDNode(LLVMContext &C, unsigned ID,<br>
> >>                                   StorageType Storage, ArrayRef<Metadata *> Vals)<br>
> >>      : MDNode(C, ID, Storage, Vals) {<br>
> >> -  if (Storage != Uniqued)<br>
> >> +  if (!isUniqued())<br>
> >>      return;<br>
> >><br>
> >>    // Check whether any operands are unresolved, requiring re-uniquing.<br>
> >> @@ -432,7 +432,7 @@ UniquableMDNode::<u></u>UniquableMDNode(LLVMCon<br>
> >>  }<br>
> >><br>
> >>  void UniquableMDNode::resolve() {<br>
> >> -  assert(Storage == Uniqued && "Expected this to be uniqued");<br>
> >> +  assert(isUniqued() && "Expected this to be uniqued");<br>
> >>    assert(!isResolved() && "Expected this to be unresolved");<br>
> >><br>
> >>    // Move the map, so that this immediately looks resolved.<br>
> >><br>
> >><br>
> >> ______________________________<u></u>_________________<br>
> >> llvm-commits mailing list<br>
> >> <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="cremed">llvm-commits@cs.uiuc.edu</a><br>
> >> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="cremed">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvm-commits</a><br>
><br>
<br>
</blockquote></div>