<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Fri, Jul 20, 2018 at 6:57 AM Florian Hahn <<a href="mailto:florian.hahn@arm.com">florian.hahn@arm.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On 12/07/2018 03:12, Eric Christopher wrote:<br>
> I've gone ahead and reverted this for now in r336877. Happy to help if <br>
> we need anything more here.<br>
> <br>
> -eric<br>
> <br>
> On Wed, Jul 11, 2018 at 3:39 PM Jordan Rupprecht via llvm-commits <br>
> <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a> <mailto:<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>>> wrote:<br>
> <br>
> It looks like this commit caused a miscompile regression (with -O1<br>
> or greater), reduced to this example:<br>
> <br>
> namespace {<br>
> template <typename T1, typename T2><br>
> bool Same(const T1& v1, const T2& v2) {<br>
> return v1 == v2;<br>
> }<br>
> <br>
> class Thing {<br>
> public:<br>
> enum Color { kPurple, kYellow };<br>
> enum Numbers { kZero };<br>
> <br>
> static bool CheckFoo(int x, Color color) {<br>
> if (!Same(kZero, x)) __builtin_abort();<br>
> if (color == kPurple) __builtin_printf("color is purple\n");<br>
> return true;<br>
> }<br>
> };<br>
> <br>
> class SomeThing : public Thing {<br>
> public:<br>
> static void DoBar() {<br>
> if (!CheckFoo(0, kPurple)) {<br>
> __builtin_printf("This should never happen\n");<br>
> }<br>
> }<br>
> };<br>
> <br>
> class OtherThing : public Thing {<br>
> public:<br>
> static void DoBar() {<br>
> if (!CheckFoo(0, kYellow)) {<br>
> __builtin_printf("This should never happen\n");<br>
> }<br>
> }<br>
> };<br>
> } // namespace<br>
> <br>
> int main(int argc, char** argv) {<br>
> SomeThing::DoBar();<br>
> OtherThing::DoBar();<br>
> return 0;<br>
> }<br>
> <br>
> Output:<br>
> $ <clang built @r336098> -O1 regression.cc && ./a.out<br>
> color is purple<br>
> This should never happen<br>
> This should never happen<br>
> $ <clang built @r336097> -O1 regression.cc && ./a.out<br>
> color is purple<br>
> It looks like this might just be uncovering a bug in an earlier<br>
> revision (r335588), but we're not sure yet. Mind if we revert this<br>
> change until we figure out what's going on?<br>
> <br>
> (I also left this comment on <a href="https://reviews.llvm.org/rL336098" rel="noreferrer" target="_blank">https://reviews.llvm.org/rL336098</a>,<br>
> reposting here for visibility)<br>
<br>
I've recommitted the patch again as r337548. The underlying issue was <br>
just exposed by the commit and was fixed in rL337507.<br>
<br>
Thanks again for the excellent reproducer and please let me know if <br>
there are any more problems with the non-reduced code.<br><br></blockquote><div><br></div><div>Thanks a ton. We'll give it a shot soon.</div><div><br></div><div>-eric </div></div></div>