On Wed, 6 Feb 2008, Richard Kenner wrote:
> > I was mainly worried about us trying to for example copy a bit-packed
> > substructure like
> >
> > struct A {
> > unsigned use_1_bit : 1;
> > struct B {
> > char large[100];
> > } b;
> > } a, b;
> >
> > where b.large[0] is at offset 1 bit of a (I believe this is possible
> > with Ada, right?).
>
> It is possible ONLY if the programmer explictly puts it there with a
> record representation clause.
>
> > If we then have the IL (no idea if we would
> > consider this valid, but this is before GIMPLE):
> >
> > a.b = b.b;
>
> ... in which case the Ada front end will know that it must never generate
> a reference to the entire field "b", but will instead generate a
> loop to copy character-by-character.
>
> > I have no idea how to best lower this ;)
>
> My feeling is to declare it invalid. You can't have a BLKmode field
> aligned at other than a byte boundary if you want to be able to access
> the field as a whole.
Thanks, that certainly makes my life easier and my brain hurt less ;)
(anyone for an Ada tutorial during the summit? ;)
Thanks,
Richard.