<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">On Sep 10, 2016, at 3:33 AM, Steve Canon <<a href="mailto:scanon@apple.com" class="">scanon@apple.com</a>> wrote:<br class=""><div><blockquote type="cite" class=""><div class=""><div dir="auto" class=""><blockquote type="cite" class=""><div class=""><blockquote type="cite" class=""><div class=""><div dir="auto" class=""><div style="direction: inherit;" class=""><br class=""></div><div style="direction: inherit;" class="">Pretty much.  In particular, imagine a user trying to debug an unexpected floating point result caused by conversion of a*b + c into fma(a, b, c).</div></div></div></blockquote><br class=""></div><div class="">I think that’s unavoidable, because of the way the optimization levels work.  Even fma contraction is on by default (something I’d like to see), at -O0, we wouldn't be doing contraction for:</div><div class=""><br class=""></div><div class="">auto x = a*b;</div><div class="">auto y = x+c;</div><div class=""><br class=""></div><div class="">but we would do that at -O2 since we do mem2reg on x.</div></blockquote><div style="direction: inherit;" class=""><br class=""></div><div style="direction: inherit;" class="">In C, we don't contract (the equivalent of) this unless we're passed fp-contract=fast.  The pragma only licenses contraction within a statement.</div></div></div></blockquote><div><br class=""></div>Ah ok.  What’s GCC’s policy on this?</div><div><br class=""><blockquote type="cite" class=""><div dir="auto" class=""><div style="direction: inherit;" class="">IIRC, the situation in C++ is somewhat different, and the standard allows contraction across statement boundaries, though I don't think we take advantage of it at present.</div></div></blockquote><div><br class=""></div><div>Is language standard pedanticism what we want to base our policies on?  It’s great to not violate the standard of course, but it would be suboptimal for switching a .c file to .cpp to change its behavior.  I’m not sure which way this cuts on this topic though, or if the cost is worth bearing.</div><br class=""><blockquote type="cite" class=""><div dir="auto" class=""><div style="direction: inherit;" class="">TLDR: yeah, let's do this.</div></div></blockquote></div><br class=""><div class="">Nice :-)</div><div class=""><br class=""></div><div class="">-Chris</div></body></html>