[cfe-users] Clang9 UBSan and GMP

David Blaikie via cfe-users cfe-users at lists.llvm.org
Thu Oct 31 13:40:36 PDT 2019


On Thu, Oct 31, 2019 at 12:00 PM Hans Ã…berg <haberg-1 at telia.com> wrote:

>
> > On 31 Oct 2019, at 18:40, David Blaikie <dblaikie at gmail.com> wrote:
> >
> >> Right, but that is something one would avoid when computing
> arithmetical results.
> >
> > One would try to, yes - but that's sort of what the whole discussion is
> resolving around: Is the code correct? I don't know. I wouldn't assume it
> is (I'm not assuming it isn't either) - but without a reduced test case
> that gets to the root of the difference in behavior, we don't know if the
> code is correct.
>
> Nor whether it is a compiler bug.
>

Indeed - but you can imagine that, on average (just due to there being way
more code compiled by the compiler, than the code of the compiler itself)
the bug is in external code, not the compiler. Such that it's not practical
for the compiler developers to do all the leg work of investigating 3rd
party code bugs to determine if it's a bug in the compiler. It doesn't
scale/we wouldn't have any time to work on the compiler & most of the time
we'd be finding user bugs, not compiler bugs.

Apologies for the snark in the title of this article, but it covers some of
the ideas:
https://blog.codinghorror.com/the-first-rule-of-programming-its-always-your-fault/
&
other articles around discuss similar ideas.

Yes, there are compiler bugs - but you've sort of got to continue under the
assumption that that's not the issue until you've got some fairly
compelling evidence of one (very narrow test case where you can look at all
the code & visually inspect/discuss/reason about its standards conformance
- currently "all of GMP" is too big to apply that level of scrutiny).

- Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20191031/f0321654/attachment.html>


More information about the cfe-users mailing list