A simple testcase to check if the attribute aligned works, fails on
i386-darwin-apple:
#include <stdio.h>
#include <stdlib.h>
int array[4128] __attribute__((aligned( 2<<6)));
int main(void)
{

  __SIZE_TYPE__ a = (__SIZE_TYPE__)(&array[0]);
  printf("%d\n", (int)(__SIZE_TYPE__)a & ((2<<6) - 1));
  if((__SIZE_TYPE__)(a) &((2<<6) - 1))
   abort ();
  return 0;
}

---- CUT ----
Note I used a seperate variable for the address to work around the fact the
trunk can fold out the alignment check.


-- 
           Summary: alignment on .comm symbol ignored
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: i386-darwin-apple


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34584

Reply via email to