This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: strict-aliasing and typedefs
On Wed, May 14, 2003 at 11:31:49PM +0200, Gabriel Dos Reis wrote:
> Andreas Schwab <schwab@suse.de> writes:
>
> [...]
>
> | int *sp;
> | int *hp;
> |
> | |> I'm wondering if a Scheme->C compiler
> | |> can use typedefs and ISO C's aliasing rules to tell gcc that certain
> | |> memory locations cannot alias each other.
> |
> | One way to do this is to define differently named structures with a single
> | member, but they may pessimize the generated code due to ABI
> | peculiarities.
>
> As I understand it, he would like an object-based non-alias
> optimization, I believe restrict is a good candidate.
That depends. Brad's initial example could also be used for type-based
non-alias optimization, for different sets of int objects - which is
somewhat looser than restrict allows.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer