Linux/ARM: Bus error with -O3 flag of clang/llvm-3.6 while running unit-test of .NET Core

Geunsik Lim via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 20 01:05:45 PDT 2016


> Clang doesn't have an attribute that's used like that though.
> For reasons I don't quite know (probably legacy GCC compatibility) this doesn't
work:
>
>   *(int __attribute__((aligned(1))) *)ptr = 2; // Wrong, attribute ignored
>
> instead you need a typedef:
>
>    typedef int __atribute__((aligned(1))) unaligned_int;
>    *(unaligned_int *)ptr = 2; // Works
>

Dear Tim,

If you already know the some webpages about the "*(int
__attribute__((aligned(1))) *)ptr = 2; // Wrong, attribute ignored"
statement,
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.

BRs,
Geunsik Lim.

On Tue, Jul 19, 2016 at 12:00 PM, Tim Northover <t.p.northover at gmail.com>
wrote:

> On 17 July 2016 at 23:35, Geunsik Lim <leemgs at gmail.com> wrote:
> >> But there's really no reason to use -O4 in the first place since it's
> >> identical to -O3.
> > Actually, I thought that -O4 means "link-time optimization" based on -O3
> > (e.g., -O3 + -flto ).
>
> Now that you say it, that rings bells. Fortunately it's definitely not
> true any more even if it was at some point. If you want LTO, you need
> to specify -flto.
>
> <snip bits on coreclr patches: I'm afraid I'm really not familiar
> enough with their code to assess them sensibly>.
>
> >> I'd expect them to be equivalent after optimization
> > Do you mean that we get the similar instructions between "memcpy()"
> library
> > call and " __attribute__(aligned(1)) keyword".
>
> Yes.
>
> Tim.
>



-- 
http://leemgs.fedorapeople.org
Don't try to avoid pain if you fail.
If you decided to face the challenges in life,
you can gain a lot by giving your best.
Cheolsang Jeong's Book & life
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160720/1a36b4b6/attachment.html>


More information about the llvm-commits mailing list