[LLVMdev] LTO "bug" and Clang warnings

Renato Golin renato.golin at linaro.org
Tue Jan 8 10:29:01 PST 2013


On 8 January 2013 16:53, David Blaikie <dblaikie at gmail.com> wrote:

> I'm not sure what you mean by "fix user's stupidity" here - could you
> clarify?
>

Buffer overrun on foo[20] and relying on it for bar[20].

It might not even be an error to access foo[50] even though foo only has 20
elements (via pointer indirection rules), but it's user error to do so, and
if the standard allows that (I'm yet to find the paragraph), then the
compiler has no right to "fix" it. If it's undefined, than LTO is
completely right and nothing should be done.

The "stupidity" part is to rely on undefined behaviour. Mind you, the
stupidity in this case was mine. I removed functions from Livermore that I
though were harmless, and added a few arrays to be initialized by others
and haven't checked that the ranges were dynamic.

cheers,
--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130108/85eec297/attachment.html>


More information about the llvm-dev mailing list