Bug 53448 - [avr] ignoring __attribute__((aligned(2)))
Summary: [avr] ignoring __attribute__((aligned(2)))
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.7.0
: P4 normal
Target Milestone: 4.7.1
Assignee: Georg-Johann Lay
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-22 08:38 UTC by Georg-Johann Lay
Modified: 2012-05-23 15:30 UTC (History)
1 user (show)

See Also:
Host:
Target: avr
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-05-22 00:00:00


Attachments
C test case (185 bytes, text/plain)
2012-05-22 08:39 UTC, Georg-Johann Lay
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Georg-Johann Lay 2012-05-22 08:38:11 UTC
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.
Comment 1 Georg-Johann Lay 2012-05-22 08:39:51 UTC
Created attachment 27474 [details]
C test case

More test cases
Comment 2 Georg-Johann Lay 2012-05-23 15:25:27 UTC
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
Comment 3 Georg-Johann Lay 2012-05-23 15:28:11 UTC
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
Comment 4 Georg-Johann Lay 2012-05-23 15:30:28 UTC
Fixed in 4.7.1