This is the mail archive of the gcc-help@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: Alignment problems with MIPS cross-compiler


Hi Roy,

As I understand it, alignment is modulo whatever the given platform supports.

If the components on MIPS only support, say, 16 bytes (which I'm just pulling out of thin air), then specifying __attribute__((__aligned__(256))) will be ineffective.

Some platforms only support alignments of 4. Others 8 or 16. I don't know what MIPS supports.

In this case, when I say "platform", that comprises the OS as well as the assembler and linker. Least useful denominator rule applies.

Also note, some (most?) platforms require that the alignment be a one of 2^x (where x is 0 to some "n"). So if you tested __attribute__((__aligned__(3))) for a RGB quantity, for example, I wouldn't be surprised to find out that it wasn't honored everywhere as one may expect. Caveat emptor!

HTH,
--Eljay


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