More on gimplify:create_tmp_var

Geert Bosch bosch@gnat.com
Wed Jun 9 18:15:00 GMT 2004


On Jun 9, 2004, at 13:38, Jason Merrill wrote:
>> The point is that a very deep nest of COMPONENT_REF, 
>> VIEW_CONVERT_EXPR,
>> and ARRAY_REF is quite common in Ada.  We don't need to make a 
>> temporary
>> (or want to) of any of the aggregates in between.  We also don't want 
>> to
>> take their address since they are non-addressable.
>
> They're non-addressable?

In the most general case they are non-addressable, as one may
have a packed array of booleans for example. Keeping these
as regular array references has the benefit that it becomes
easy to tell that stores to A (3) and A (5) are independent.
Once this get expanded to byte/word loads, mask operations
and writes, this becomes very hard to tell. Furthermore,
deciding what types to use for expansion depends on the target
machine.

In almost all cases, components of composite types (records/arrays)
cannot be aliased by pointers in the user's code. This is similar
to Fortran. If we would flatten these references in the front end,
we would loose all the aliasing information. If we're accessing
field F of record type R in two places, we may not be able to
disambiguate these aliases. However, accesses to P.R.F and Q.R.F
are clearly independent.



More information about the Gcc mailing list