<div dir="ltr">> <span style="font-size:12.8px">Clang doesn't have an attribute that's used like that though. <br>> For </span><span style="font-size:12.8px">reasons I don't quite know (probably legacy GCC compatibility) this </span><span style="font-size:12.8px">doesn't work:</span><br style="font-size:12.8px">> <br style="font-size:12.8px"><span style="font-size:12.8px">>   *(int __attribute__((aligned(1))) *)ptr = 2; // Wrong, attribute ignored</span><br style="font-size:12.8px">> <br style="font-size:12.8px">> <span style="font-size:12.8px">instead you need a typedef:</span><br style="font-size:12.8px">> <br style="font-size:12.8px">> <span style="font-size:12.8px">   typedef int __atribute__((aligned(1))) unaligned_int;</span><br style="font-size:12.8px">> <span style="font-size:12.8px">   *(unaligned_int *)ptr = 2; // Works</span><div>> <br><span style="font-size:12.8px"><br>Dear Tim, </span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">If you already know the some webpages about the "</span><span style="font-size:12.8px">*(int __attribute__((aligned(1))) *)ptr = 2; // Wrong, attribute ignored" statement, <br>Could you share me that? I would like to use the statement ASAP because there are too many UNALIGNED usages in the CoreCLR source code.<br><br>BRs,</span></div><div><span style="font-size:12.8px">Geunsik Lim. </span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 19, 2016 at 12:00 PM, Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 17 July 2016 at 23:35, Geunsik Lim <<a href="mailto:leemgs@gmail.com">leemgs@gmail.com</a>> wrote:<br>
>> But there's really no reason to use -O4 in the first place since it's<br>
>> identical to -O3.<br>
> Actually, I thought that -O4 means "link-time optimization" based on -O3<br>
> (e.g., -O3 + -flto ).<br>
<br>
</span>Now that you say it, that rings bells. Fortunately it's definitely not<br>
true any more even if it was at some point. If you want LTO, you need<br>
to specify -flto.<br>
<br>
<snip bits on coreclr patches: I'm afraid I'm really not familiar<br>
enough with their code to assess them sensibly>.<br>
<span class=""><br>
>> I'd expect them to be equivalent after optimization<br>
> Do you mean that we get the similar instructions between "memcpy()"  library<br>
> call and " __attribute__(aligned(1)) keyword".<br>
<br>
</span>Yes.<br>
<span class="HOEnZb"><font color="#888888"><br>
Tim.<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><a href="http://leemgs.fedorapeople.org" style="font-family:Tahoma" target="_blank">http://leemgs.fedorapeople.org</a><span style="font-family:Tahoma"> </span></div><div>Don't try to avoid pain if you fail.<br>If you decided to face the challenges in life, <br>you can gain a lot by giving your best.<br>Cheolsang Jeong's Book & life<br>--<br></div></div></div>
</div>