int var __attribute__((aligned(2))) = 1; gets compiled to .global var .data .type var, @object .size var, 2 var: .word 1 i.e. the alignment directive .p2align 1 is missing.
Created attachment 27474 [details] C test case More test cases
Author: gjl Date: Wed May 23 15:25:22 2012 New Revision: 187803 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187803 Log: PR target/53448 * config/avr/avr.h (ASM_OUTPUT_ALIGN): Don't inhibit .p2align 1. * config/avr/elf.h (ASM_OUTPUT_BEFORE_CASE_LABEL): Use ASM_OUTPUT_ALIGN. Modified: trunk/gcc/ChangeLog trunk/gcc/config/avr/avr.h trunk/gcc/config/avr/elf.h
Author: gjl Date: Wed May 23 15:28:05 2012 New Revision: 187804 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187804 Log: Backport from 2012-05-23 mainline r187803 PR target/53448 * config/avr/avr.h (ASM_OUTPUT_ALIGN): Don't inhibit .p2align 1. * config/avr/elf.h (ASM_OUTPUT_BEFORE_CASE_LABEL): Use ASM_OUTPUT_ALIGN. Modified: branches/gcc-4_7-branch/gcc/ChangeLog branches/gcc-4_7-branch/gcc/config/avr/avr.h branches/gcc-4_7-branch/gcc/config/avr/elf.h
Fixed in 4.7.1