[Webkit-unassigned] [Bug 196533] [META] Undefined behavior bugs

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 3 14:39:46 PDT 2019


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

--- Comment #6 from Yusuke Suzuki <ysuzuki at apple.com> ---
(In reply to Yusuke Suzuki from comment #5)
> (In reply to Filip Pizlo from comment #3)
> > The first of those is just not a bug. CPUs we target ignore the high bits of
> > a shift amount. This code would only be recompiled if the shift amount ended
> > up being a constant.
> 
> I think the problem of UB is not CPU related thing. CPU behavior is really
> nice, and meets our expectation.
> Rather, I think the typical UB-related problem is caused because of the C
> compiler's assumption "dev never does UB" (clearly, it is wrong).
> This assumption introduces restriction on some value's range (like, "you are
> doing "v << x", so, x should be [0, 64), and let's use this information to
> do further optimizations"), it leads to "aggressively" optimized code, which
> does not meet our expected behavior.
> One of the issue I remember is that
> https://trac.webkit.org/changeset/195906/webkit, GCC leverages our UB
> behavior and does "optimizations" which makes B3 broken.
> 
> My thought on UB is,
> 
> 1. If we can easily avoid UB, we should do that.

In particular, signed integer overflow, too large shift amount, and use of uninitialized value.

-- 
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/20190403/75da4a23/attachment-0001.html>


More information about the webkit-unassigned mailing list