Hi Duncan,<br><br>I included original email in BUG description which described original issue with store being removed.<br><br>BR<br>Seb<br><br><div class="gmail_quote">2012/2/29 Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr">baldrick@free.fr</a>></span><br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Seb,<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Already done here : <a href="http://llvm.org/bugs/show_bug.cgi?id=12130" target="_blank">http://llvm.org/bugs/show_bug.<u></u>cgi?id=12130</a><br>
</blockquote>
<br></div>
that doesn't describe the original issue (second store removed), it is talking<br>
about a different issue that appeared at -O1 (and it first seemed to explain<br>
your original problem; but now I think the -O1 transform was correct and does<br>
not explain your original problem).<br>
<br>
Ciao, Duncan.<br>
<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Thanks for your answers<br>
Best Regards<br>
Seb<br>
<br>
2012/2/29 Duncan Sands <<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a> <mailto:<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a>>><div class="im"><br>
<br>
    Hi Seb,<br>
<br>
<br>
        If I remove datalayout definition, code is not optimized and work as<br>
        expected.<br>
        So my question is:<br>
<br>
        What attribute/value/interpretation of data-layout would cause this type<br>
        of bug?<br>
<br>
<br>
    all kinds of optimizers use datalayout (and are disabled if there is none).  For<br>
    example, alias analysis, anything that needs to understand getelementptr<br>
    offsets, the list is endless.<br>
<br>
    I suggest you open a bug report, describing your original problem as in your<br>
    first email.<br>
<br>
    Ciao, Duncan.<br>
<br>
        Thanks for your answers<br>
        Seb<br>
<br>
        2012/2/28 Duncan Sands <<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a> <mailto:<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a>><br></div>
        <mailto:<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a> <mailto:<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a>>>><div class="im"><br>
<br>
<br>
            On 28/02/12 17:48, John Regehr wrote:<br>
         >> void t2(double *x)<br>
         >> {<br>
         >>       long long a[2];<br>
         >>       a[0] = 3;<br>
         >>       a[1] = 5;<br>
         >>       *x = * ((double *) a);<br>
         >>       *(x+1) = * ((double *) &a[a[0]-2]);<br>
         >> }<br>
         ><br>
         > Doesn't this code violate the strict aliasing rules?<br>
<br>
            Maybe, but the LLVM IR he showed seems perfectly well defined.<br>
<br>
            Ciao, Duncan.<br>
            ______________________________ _________________<br>
            LLVM Developers mailing list<br>
        <a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <mailto:<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>><br></div>
        <mailto:<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <mailto:<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>>><div class="im"><br>
        <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
        <a href="http://lists.cs.uiuc.edu/" target="_blank">http://lists.cs.uiuc.edu/</a> mailman/listinfo/llvmdev<br></div>
        <<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvmdev</a>><br>
<br>
<br>
<br>
<br>
</blockquote>
<br>
</blockquote></div><br>