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]

memory alignment question


Hi folks,

I am trying to get some memory aligned on a quad word on the stack for
Altivec.

I made this program :

#include <stdio.h>

int main(void) {
	int tab[6][64] __attribute__ ((__aligned__(16)));

	printf("%p\n",&tab);
	return 0;
}

Unfortunately, when I run this program on PPC or x86, I never got
something aligned on 16 bytes.

e.g

guillaum@siri:~/dev/c/try$ ./uffu
0x7ffff328

guillaum@cedar ~$ ./try
tab == 0xbffff8cc

I tried with gcc 2.95 or gcc 3.0.x, ld version 2.12.90.0.1 or 2.9.5.

Am I missing something ? Sorry if it is obvious, I am new to this kind
of problems. I tried to RTFM before asking, got no results.

TIA. Regards,

-- 
Guillaume Morin <guillaume@morinfr.org>

      A friend in need is a friend indeed. A friend who bleeds is better.
         My friend confessed, she passed the test. We will never sever.
                                   (Placebo)


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