<div dir="ltr">Do you know the function name that is affected? <div><br></div><div>David</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 6, 2017 at 5:14 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Here is a zip file with 3 files: before.ll, after.ll, and passes-disabled.ll.<div><a href="https://drive.google.com/open?id=0B5-KodWdXF4YLVA5UUFkWnBvRWM" target="_blank">https://drive.google.com/open?<wbr>id=0B5-<wbr>KodWdXF4YLVA5UUFkWnBvRWM</a><br></div><div><br></div><div>Hopefully `opt -O2 passes-disabled.ll` shows the interesting transform.</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 6, 2017 at 5:06 PM, Xinliang David Li <span dir="ltr"><<a href="mailto:davidxl@google.com" target="_blank">davidxl@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">that will be great.   InstCombine is iterative, so it usually creates huge text diff. To minimize the diff, the DEBUG_COUNTER  (which is used by instcombine) can be used to pin-point one combining that triggers the mis-behavior.<span class="m_206968462238544532HOEnZb"><font color="#888888"><div><br></div><div>David</div></font></span></div><div class="m_206968462238544532HOEnZb"><div class="m_206968462238544532h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 6, 2017 at 5:00 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">It's a normal release build. I'm pretty sure I know which TU is miscompiled (SemaExpr.cpp), so I'll get the textual IR before and after this change. Hopefully it'll be obvious that they aren't equivalent.</div><div class="m_206968462238544532m_-3489487575748669835HOEnZb"><div class="m_206968462238544532m_-3489487575748669835h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 6, 2017 at 4:23 PM, Xinliang David Li <span dir="ltr"><<a href="mailto:davidxl@google.com" target="_blank">davidxl@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div class="m_206968462238544532m_-3489487575748669835m_5831787554600615788h5"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 6, 2017 at 4:08 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Fri, Oct 6, 2017 at 2:50 PM, Xinliang David Li <span dir="ltr"><<a href="mailto:davidxl@google.com" target="_blank">davidxl@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="m_206968462238544532m_-3489487575748669835m_5831787554600615788m_2147208982390995216m_2886238593980670354gmail-">On Fri, Oct 6, 2017 at 2:20 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">This appears to have caused a bootstrap failure on Windows:<div><a href="http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/6884" target="_blank">http://lab.llvm.org:8011/build<wbr>ers/clang-x64-ninja-win7/build<wbr>s/6884</a><br></div><div><a href="http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/7611" target="_blank">http://lab.llvm.org:8011/build<wbr>ers/clang-x86-windows-msvc2015<wbr>/builds/7611</a><br></div><div><br></div><div>I am going to revert and try to reproduce. It looks like clang ends up emitting an error on valid code.</div></div></blockquote><div><br></div></span><div>Please help with the reproducible -- it will be hard for me to get a repro on windows.</div></div></div></div></blockquote><div><br></div></span><div>Can you build clang with your patch and try to compile this code?</div><div><br></div><div>char *f(char *p, int i) {<br></div><div>  return p + i;</div><div>}</div><div><br></div><div>If clang says:</div><div>t.c:2:12: error: invalid operands to binary expression ('char *' and 'int')</div><div>  return p + i;</div><div>         ~ ^ ~</div><div>1 error generated. </div><div><br></div><div>Then you have the miscompile locally and it doesn't require Windows.</div></div></div></div>
</blockquote></div><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></div></div><div class="gmail_extra">How is the self build compiler built? I have one built with RelWithDebInfo, and that compiler compiles this case fine without an error.</div><span class="m_206968462238544532m_-3489487575748669835m_5831787554600615788HOEnZb"><font color="#888888"><div class="gmail_extra"><br></div><div class="gmail_extra">David</div></font></span></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>