This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug c/46859] Attribute depends on location


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


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