This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: IMA vs tree-ssa


On Mon, 8 Mar 2004, Mark Mitchell wrote:

> are valid whether within one translation unit or across two.  But, you 
> cannot complete the same structure type in two different ways in the 
> same translation unit.  The idea that in C you could not validly combine 
> all your translation units into a single translation unit (with  
> appropriate alpha-renaming of things with internal linkage, and with 
> appropriate merger of tentative definitions, if you've adopted that 
> (optional) behavior) is, to me, in contradiction with the spirit of the 
> language requiring declarations to have compatible types across 
> translation units.

As far as I know you can combine translation units.  Any object or
function must have compatible complete type in all translation units.  It
may, however, be necessary to split up named structure or union types into
several separate such named types, one for each incompatible completion of
that type, but each object or function defined using such a type can be
unambiguously assigned at most one completion (otherwise there is
undefined behavior).

In the example of aliasing given, if this is applied with enums and the
corresponding integer type it shows the enums *can* alias each other: the
enums are both compatible with the effective type of the object (the
compatible integer type) which is its declared type.  This may need to be
applied in general for aliasing among types which could be composite types
arising from the same type.

-- 
Joseph S. Myers
jsm@polyomino.org.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]