[LLVMdev] Is it an opt bug ?

Seb babslachem at gmail.com
Wed Feb 29 01:26:28 PST 2012


Hi all,

If I remove datalayout definition, code is not optimized and work as
expected.
So my question is:

What attribute/value/interpretation of data-layout would cause this type of
bug?
Thanks for your answers
Seb

2012/2/28 Duncan Sands <baldrick at free.fr>

> On 28/02/12 17:48, John Regehr wrote:
> >> void t2(double *x)
> >> {
> >>       long long a[2];
> >>       a[0] = 3;
> >>       a[1] = 5;
> >>       *x = * ((double *) a);
> >>       *(x+1) = * ((double *) &a[a[0]-2]);
> >> }
> >
> > Doesn't this code violate the strict aliasing rules?
>
> Maybe, but the LLVM IR he showed seems perfectly well defined.
>
> Ciao, Duncan.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120229/1fb33ac0/attachment.html>


More information about the llvm-dev mailing list