------- Comment #2 from jakub at gcc dot gnu dot org 2010-03-08 21:07 ------- On the: int i; static int j; extern int bar (void); int foo (void) { return i + j + bar (); } testcase with -fexceptions -O2 -mtune=generic -dA -m32 -fpic the difference is: @@ -14,9 +14,9 @@ foo: .cfi_def_cfa_register 5 subl $8, %esp movl %ebx, (%esp) + .cfi_offset 3, -16 call __i686.get_pc_thunk.bx addl $_GLOBAL_OFFSET_TABLE_, %ebx - .cfi_offset 3, -16 movl %esi, 4(%esp) movl i...@got(%ebx), %eax movl (%eax), %esi @@ -43,6 +43,8 @@ foo: .hidden __i686.get_pc_thunk.bx .type __i686.get_pc_thunk.bx, @function __i686.get_pc_thunk.bx: + .cfi_startproc movl (%esp), %ebx ret + .cfi_endproc .section .note.GNU-stack,"",@progbits and with -fexceptions -O2 -mtune=i586 -dA -m32 -fpic -fomit-frame-pointer the difference is:@@ -14,11 +14,13 @@ foo: subl $4, %esp .cfi_def_cfa_offset 16 call .L2 + .cfi_def_cfa_offset 20 .L2: popl %ebx - addl $_GLOBAL_OFFSET_TABLE_+[.-.L2], %ebx .cfi_offset 3, -12 .cfi_offset 6, -8 + .cfi_def_cfa_offset 16 + addl $_GLOBAL_OFFSET_TABLE_+[.-.L2], %ebx movl i...@got(%ebx), %eax movl (%eax), %esi call b...@plt
-- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43293