Subject: Re: mips gcc4 ld.elf_so problems
To: matthew green <mrg@eterna.com.au>
From: Jason Thorpe <thorpej@shagadelic.org>
List: tech-toolchain
Date: 06/27/2006 12:53:34
On Jun 27, 2006, at 12:49 PM, matthew green wrote:

>
>> which compiles to use "sw" in both the novoid cases and swl/swr in
>> the other case.  ie, when GCC starts off with what it believes
>> should be an aligned pointer ("Elf_Addr *p"), or ends up with one
>> via an assignment, it will keep that information right into builtins
>> like this and optimise based on it.
>
> actually, there is a bug in the test for the "void_novoid" test - when
> using the right variables it also uses the unaligned stores.
>
>    what happens if you make store_ptr() not an inline?
>
> then store_ptr becomes a real function that uses unaligned stores,
> probably working.  i wonder the effect this has on program startup
> since it generates between 7 and 10 extra instructions (including
> a branch & return.)

...and what happens if you open-code the copy in store_ptr() instead  
of calling memcpy() (keeping store_ptr() as an inline).

Seems that THAT would be the least-invasive change to make.


-- thorpej