Apparently I had a problem of double pointer. The solution was to use

static Tinst : &'static T = 1000;

though I have modified the code now so that T works as well.


On Sun, Apr 20, 2014 at 2:04 PM, György Andrasek <[email protected]> wrote:

> On Sun, Apr 20, 2014 at 10:46 AM, Vladimir Pouzanov <[email protected]>
> wrote:
> > The results in the following IR:
> >
> > @Tinst = internal constant %struct.T* inttoptr (i32 1000 to %struct.T*)
> >
> > The problem is that llvm never inlines the constant (even with
> > #[address_insignificant]), so instead of making the binary smaller as
> llvm
> > can optimize integer addresses better (as it knows them) it makes the
> binary
> > bigger, as it takes 4 bytes to store address value in .rodata, and two
> > instructions to fetch it.
>
> Does it show up in the asm after optimizations? After LTO?
>



-- 
Sincerely,
Vladimir "Farcaller" Pouzanov
http://farcaller.net/
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to