[Webkit-unassigned] [Bug 232951] Prevent fused multiply add during ParseInt

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 10 12:08:10 PST 2021


https://bugs.webkit.org/show_bug.cgi?id=232951

--- Comment #8 from Mikhail R. Gadelha <mikhail at igalia.com> ---
(In reply to Yusuke Suzuki from comment #7)
> Comment on attachment 443839 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=443839&action=review
> 
> > Source/JavaScriptCore/runtime/ParseInt.h:113
> > +// Due to a GCC bug found in v8.4.0, a wrong fused multiply-add optimization can be inserted when calculating the final number,
> > +// in number *= radix; number += digit;, so optimizations are disabled for this functions.
> > +#pragma GCC push_options
> > +#pragma GCC optimize ("O0")
> 
> 1. Why not only disabling fp-contract? We do not need to disable all
> optimizations. (See comment
> https://bugs.webkit.org/show_bug.cgi?id=232951#c5)
> 2. Why not using function attribute?

I just tried adding `__attribute__((optimize("fp-contract=off")))` locally to the function definition and gcc seems to ignore it, i.e., it generates de fma and the test fails.

> 3. Use it only for GCC. Clang does not need this.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20211110/0902d3d9/attachment.htm>


More information about the webkit-unassigned mailing list