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: Question about generated type for common block in fortran


Hi,

On Wed, 8 Nov 2017, Richard Biener wrote:

> Not sure how - the issue is the FIELD_DECLs overlap which rules out a 
> RECORD_TYPE and leaves us with a UNION_TYPE.

No, as the initial mail already mentioned, for the example in 
question the overlapping fields can be put into a union which itself is 
part of a struct:

struct S {
  union { T mem1[len]; T overlap1[len]; };
  union { T mem2[len]; T overlap2[len]; };
};

If you do real fancy equivalences with partial overlaps then you're right, 
the type necessarily will look strange then.  But for this example the 
type could be improved (if that helps anything I don't know, though).


Ciao,
Michael.


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