[PATCH] Vectorizing Global Structures - Take 2

Renato Golin renato.golin at linaro.org
Sat Feb 16 04:57:25 PST 2013


On 16 February 2013 00:38, Daniel Berlin <dberlin at dberlin.org> wrote:

> you fall into the "otherwise, the behavior is undefined".
>
> It would be explicitly valid to convert it to char *, and read it up
> to and through B, but not using the array access operator.
>

Unfortunately, "undefined behaviour" is valid C. It means you'll have to
compile that without error (possibly a warning), but you're allowed to do
whatever you want.

Clang sometimes remove accesses if they're going to go outside the
boundaries (if it can tell) as optimization, as we seen in the Livermore
Loops example. GCC vectorizes a loop when the only aliasing possible is
with out-of-bounds access (thus getting different results). All that falls
into the category of "user error", so both Clang and GCC won't change their
behaviour on optimized builds.

cheers,
--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130216/93d096e9/attachment.html>


More information about the llvm-commits mailing list