DATA_ALIGNMENT vs. DECL_USER_ALIGNMENT

Alexandre Oliva aoliva@redhat.com
Tue Apr 22 05:59:00 GMT 2003


On Apr 21, 2003, kenner@vlsi1.ultra.nyu.edu (Richard Kenner) wrote:

>     So if you turn:
>     T i __attribute__((align(2)));
>     T j __attribute__((align(2)));

>     into

>     typedef T T2 __attribute__((align(2)));
>     T2 i, j;

>     you say we could get different code?  

> I say so, yes.

> And the reason is as I said: you specify alignment for a type both for
> interface and efficiency reasons, but for an object only for the latter.
> So there is a difference in meaning between these two constructs.

But the compiler can't tell whether, when you specify alignment for a
type, you mean for interface or for efficiency, so I think it
shouldn't make an assumption that it's to be used only for the former
case like you seem to believe it should do.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer



More information about the Gcc-patches mailing list