This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Support large alignments for commons on arm-elf
- To: Nick Clifton <nickc at cambridge dot redhat dot com>
- Subject: Re: Support large alignments for commons on arm-elf
- From: Andreas Jaeger <aj at suse dot de>
- Date: 04 May 2001 18:27:57 +0200
- Cc: gcc-patches at gcc dot gnu dot org
- References: <m3k83xavgf.fsf@north-pole.nickc.cambridge.redhat.com>
Nick Clifton <nickc@cambridge.redhat.com> writes:
> Hi Guys,
>
> Intel have reported that the arm-elf toolchain does not properly
> support the aligned() attribute for large (> 4) alignments on
> commons. For example, this test fails:
>
> typedef struct align
> {
> unsigned long a[1];
> unsigned long b[1] __attribute__ ((aligned (8)));
> unsigned long c[1] __attribute__ ((aligned (16)));
> unsigned long d[1] __attribute__ ((aligned (32)));
> } ALIGN;
>
> ALIGN gs;
>
> int
> main (void)
> {
> if ((((unsigned int) gs.b) & 0x00000007) ||
> (((unsigned int) gs.c) & 0x0000000f) ||
> (((unsigned int) gs.d) & 0x0000001f))
> {
> printf ("GLOBAL STRUCT TEST: FAIL\n");
>
> printf ("%x %x %x\n",
> (unsigned int) gs.b,
> (unsigned int) gs.c,
> (unsigned int) gs.d);
> }
> else
> printf ("GLOBAL STRUCT TEST: PASS\n");
>
> return 0;
> }
>
> The problem is that the port is not talking advantage of the
> alignment field support by the assembler .comm directive on ELF
> based ports.
>
> I am applying the patch below to fix this.
Wouldn't it make sense to add the test also to our testsuite?
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj