<div dir="ltr">Hi,<div><br></div><div>I downloaded the latest NDK (r10) and compiled with the following cmd:</div><div><font color="#444444" face="Arial, Liberation Sans, DejaVu Sans, sans-serif"><span style="line-height:17.280000686645508px"><b><i>arm-linux-androideabi-clang myMemcpy.c -S -fno-builtin -o0</i></b></span></font><br>


</div><div><font color="#444444" face="Arial, Liberation Sans, DejaVu Sans, sans-serif"><span style="line-height:17.280000686645508px;background-color:rgb(250,250,250)">It still produces assembly with a call to "memcpy". Maybe the -</span></font><b style="color:rgb(68,68,68);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.280000686645508px"><i>fno-builtin </i></b><span style="line-height:17.280000686645508px;color:rgb(68,68,68);font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;background-color:rgb(250,250,250)">is broken also in the latest release.</span></div>


<div><font color="#444444" face="Arial, Liberation Sans, DejaVu Sans, sans-serif"><span style="line-height:17.280000686645508px;background-color:rgb(250,250,250)">Do you have some other idea that can help here?</span></font></div>


<div><font color="#444444" face="Arial, Liberation Sans, DejaVu Sans, sans-serif"><span style="line-height:17.280000686645508px;background-color:rgb(250,250,250)"><br></span></font></div><div><font color="#444444" face="Arial, Liberation Sans, DejaVu Sans, sans-serif"><span style="line-height:17.280000686645508px;background-color:rgb(250,250,250)">Thanks,</span></font></div>


<div><font color="#444444" face="Arial, Liberation Sans, DejaVu Sans, sans-serif"><span style="line-height:17.280000686645508px;background-color:rgb(250,250,250)">David</span></font></div><div class="gmail_extra"><br>
<br><div class="gmail_quote">On Tue, Aug 5, 2014 at 11:00 AM, Jim Grosbach <span dir="ltr"><<a href="mailto:grosbach@apple.com" target="_blank">grosbach@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


<div dir="auto"><div>I'm not sure then. Clang 3.1 is rather old. It's possible that was broken in that version. Sorry I wasn't more help. That's the correct option to control the behavior. </div><div><div>


<div><br>On Aug 5, 2014, at 12:01 AM, David Sela <<a href="mailto:sela.david@gmail.com" target="_blank">sela.david@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">Hi Jim,<div>I have tried <span style="font-family:arial,sans-serif;font-size:12.727272033691406px">"-fno-builtin</span>" but it didn't help.</div>


<div>Thanks,</div><div>David</div></div><div class="gmail_extra">

<br><br><div class="gmail_quote">On Tue, Aug 5, 2014 at 12:12 AM, Jim Grosbach <span dir="ltr"><<a href="mailto:grosbach@apple.com" target="_blank">grosbach@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">




<div style="word-wrap:break-word">Hi David,<div><br></div><div>"-fno-builtin” is probably what you want.</div><div><br></div><div>-Jim</div><div><br><div><blockquote type="cite"><div><div><div>On Aug 4, 2014, at 2:19 AM, David Sela <<a href="mailto:sela.david@gmail.com" target="_blank">sela.david@gmail.com</a>> wrote:</div>




<br></div></div><div><div><div><div dir="ltr"><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.804800033569336px">






Clang optimizes code by replacing some parts with efficient library functions.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.804800033569336px">






For example the following code:</p><pre style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:14px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;overflow:auto;width:auto;max-height:600px;word-wrap:normal;line-height:17.804800033569336px;background-color:rgb(238,238,238)">

<code style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;white-space:inherit;background-image:initial;background-repeat:initial">for (i=0;i<size;++i)
       dest[i]=src[i];
</code></pre><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.804800033569336px">






will be compiled to (target=ARM assembly):</p><pre style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:14px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;overflow:auto;width:auto;max-height:600px;word-wrap:normal;line-height:17.804800033569336px;background-color:rgb(238,238,238)">

<code style="margin:0px;padding:0px;border:0px;font-size:14px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;white-space:inherit;background-image:initial;background-repeat:initial">bl      __aeabi_memcpy(PLT)
</code></pre><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.804800033569336px">






<span style="font-size:14px">The compile cmd:</span></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.804800033569336px">






<span style="color:rgb(68,68,68);font-size:13px;line-height:17.280000686645508px">/usr/share/android-arm-l14-toolchain/bin/clang31 -cc1 -triple arm-none-linux-androideabi -S -target-abi aapcs-linux -target-cpu arm1022e -backend-option -arm-enable-ehabi -backend-option -arm-enable-ehabi-descriptors -backend-option -arm-ignore-has-ras -internal-isystem /usr/share/android-arm-l14-toolchain/lib/clang/3.1/include -internal-externc-isystem /usr/share/android-arm-l14-toolchain/bin/../sysroot/usr/include -o myMemcpy.s -x c myMemcpy.c</span><span style="font-size:14px"><br>






</span></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.804800033569336px">






<span style="font-size:14px"><br></span></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.804800033569336px">






<span style="font-size:14px">Is there a flag or some other way to prevent the compiler from replacing the code with library calls?</span><br></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.804800033569336px">






<span style="font-size:14px"><br></span></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.804800033569336px">






<span style="font-size:14px">Thanks in advance,<br></span><span style="font-size:14px">David</span><span style="font-size:14px"><br></span></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:14px;vertical-align:baseline;clear:both;font-family:Arial,'Liberation Sans','DejaVu Sans',sans-serif;line-height:17.804800033569336px">






<span style="font-size:14px"><br></span></p></div></div></div>
_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>




<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></div></blockquote></div><br></div></div></blockquote></div><br></div>
</div></blockquote></div></div></div></blockquote></div><br></div></div>