<div dir="ltr">I've gone ahead and reverted this for now in r336877. Happy to help if we need anything more here.<div><br></div><div>-eric<br><div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jul 11, 2018 at 3:39 PM Jordan Rupprecht via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>It looks like this commit caused a miscompile regression (with -O1 or greater), reduced to this example:</div><div><br></div><div>namespace {</div><div>template <typename T1, typename T2></div><div>bool Same(const T1& v1, const T2& v2) {</div><div> return v1 == v2;</div><div>}</div><div><br></div><div>class Thing {</div><div> public:</div><div> enum Color { kPurple, kYellow };</div><div> enum Numbers { kZero };</div><div><br></div><div> static bool CheckFoo(int x, Color color) {</div><div> if (!Same(kZero, x)) __builtin_abort();</div><div> if (color == kPurple) __builtin_printf("color is purple\n");</div><div> return true;</div><div> }</div><div>};</div><div><br></div><div>class SomeThing : public Thing {</div><div> public:</div><div> static void DoBar() {</div><div> if (!CheckFoo(0, kPurple)) {</div><div> __builtin_printf("This should never happen\n");</div><div> }</div><div> }</div><div>};</div><div><br></div><div>class OtherThing : public Thing {</div><div> public:</div><div> static void DoBar() {</div><div> if (!CheckFoo(0, kYellow)) {</div><div> __builtin_printf("This should never happen\n");</div><div> }</div><div> }</div><div>};</div><div>} // namespace</div><div><br></div><div>int main(int argc, char** argv) {</div><div> SomeThing::DoBar();</div><div> OtherThing::DoBar();</div><div> return 0;</div><div>}</div><div><br></div><div>Output:</div><div>$ <clang built @r336098> -O1 regression.cc && ./a.out</div><div>color is purple</div><div>This should never happen</div><div>This should never happen</div><div>$ <clang built @r336097> -O1 regression.cc && ./a.out</div><div>color is purple</div><div>It looks like this might just be uncovering a bug in an earlier revision (r335588), but we're not sure yet. Mind if we revert this change until we figure out what's going on?</div><div><br></div></div>(I also left this comment on <a href="https://reviews.llvm.org/rL336098" target="_blank">https://reviews.llvm.org/rL336098</a>, reposting here for visibility)<br></div>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div></div></div>