This is the mail archive of the gcc-patches@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]

Re: Support large alignments for commons on arm-elf


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


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