This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/46859] Attribute depends on location
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 9 Dec 2010 15:44:53 +0000
- Subject: [Bug c/46859] Attribute depends on location
- Auto-submitted: auto-generated
- References: <bug-46859-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46859
--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2010-12-09 15:44:49 UTC ---
Shouldn't foo1/foo2 have the same alignment?
[hjl@gnu-6 pages-1]$ cat x.c
typedef int * ptr_t;
ptr_t
__attribute__((aligned(4096)))
foo1 ()
{
return 0;
}
int *
__attribute__((aligned(4096)))
foo2 ()
{
return 0;
}
[hjl@gnu-6 pages-1]$ gcc -S x.c
[hjl@gnu-6 pages-1]$ cat x.s
.file "x.c"
.text
.align 4096
.globl foo1
.type foo1, @function
foo1:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size foo1, .-foo1
.globl foo2
.type foo2, @function
foo2:
.LFB1:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE1:
.size foo2, .-foo2