Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***************************************************************************/
- #include <stddef.h>
- extern long xxx;
- struct a {char x; char y;};
- struct b {short x; char y;};
- extern void g_0(long,long,long,long);
- void f_0(long a,long b,long c)
- {
- return g_0(xxx,a,b,c);
- }
- extern void g_1(struct a,struct a,struct b);
- void f_1(struct a a, struct b b)
- {
- return g_1((struct a){1,2},a,b);
- }
- void foo(void)
- {
- extern void h(struct a, struct b);
- return h
- ((struct a){1,2}
- ,(struct b){33,44});
- }
- void bar(void)
- {
- return g_1
- ((struct a){1,2}
- ,(struct a){5,7}
- ,(struct b){33,44});
- }
- struct c {size_t x; char y;};
- extern void zzz(struct c, char);
- void baz(void)
- {
- return zzz((struct c){-1,7},5);
- }
- /***************************************************************************/
- #if 0
- [m@monire ~]$ c2asm.sh < callconv_shift.c
- .file "tmp.8Pd8FsoyLu.c"
- .text
- .p2align 4,,15
- .globl f_0
- .type f_0, @function
- f_0:
- movq %rdx, %rcx
- movq %rsi, %rdx
- movq %rdi, %rsi
- movq xxx(%rip), %rdi
- jmp g_0
- .size f_0, .-f_0
- .p2align 4,,15
- .globl f_1
- .type f_1, @function
- f_1:
- subq $8, %rsp
- movl %esi, %edx
- movl %edi, %esi
- movl $513, %edi
- call g_1
- addq $8, %rsp
- ret
- .size f_1, .-f_1
- .p2align 4,,15
- .globl foo
- .type foo, @function
- foo:
- subq $8, %rsp
- movl $2883617, %esi
- movl $513, %edi
- call h
- addq $8, %rsp
- ret
- .size foo, .-foo
- .p2align 4,,15
- .globl bar
- .type bar, @function
- bar:
- subq $8, %rsp
- movl $2883617, %edx
- movl $1797, %esi
- movl $513, %edi
- call g_1
- addq $8, %rsp
- ret
- .size bar, .-bar
- .p2align 4,,15
- .globl baz
- .type baz, @function
- baz:
- subq $24, %rsp
- movq $-1, %rdi
- movl $5, %edx
- movb $7, 8(%rsp)
- movl 8(%rsp), %esi
- movq %rdi, (%rsp)
- call zzz
- addq $24, %rsp
- ret
- .size baz, .-baz
- .ident "GCC: (GNU) 4.6.0 20110115 (experimental)"
- .section .note.GNU-stack,"",@progbits
- #endif
- /***************************************************************************/
- #if 0
- [m@monire ~]$ c2asm_32.sh < callconv_shift.c
- .file "tmp.jFXnYPtufG.c"
- .text
- .p2align 4,,15
- .globl f_0
- .type f_0, @function
- f_0:
- subl $28, %esp
- movl 40(%esp), %eax
- movl %eax, 12(%esp)
- movl 36(%esp), %eax
- movl %eax, 8(%esp)
- movl 32(%esp), %eax
- movl %eax, 4(%esp)
- movl xxx, %eax
- movl %eax, (%esp)
- call g_0
- addl $28, %esp
- ret
- .size f_0, .-f_0
- .p2align 4,,15
- .globl f_1
- .type f_1, @function
- f_1:
- subl $28, %esp
- movl 36(%esp), %eax
- movw $513, (%esp)
- movl %eax, 8(%esp)
- movzwl 32(%esp), %eax
- movw %ax, 4(%esp)
- call g_1
- addl $28, %esp
- ret
- .size f_1, .-f_1
- .p2align 4,,15
- .globl foo
- .type foo, @function
- foo:
- subl $28, %esp
- movl $2883617, 4(%esp)
- movw $513, (%esp)
- call h
- addl $28, %esp
- ret
- .size foo, .-foo
- .p2align 4,,15
- .globl bar
- .type bar, @function
- bar:
- subl $28, %esp
- movl $2883617, 8(%esp)
- movw $1797, 4(%esp)
- movw $513, (%esp)
- call g_1
- addl $28, %esp
- ret
- .size bar, .-bar
- .p2align 4,,15
- .globl baz
- .type baz, @function
- baz:
- subl $28, %esp
- movl $5, 8(%esp)
- movl $-1, (%esp)
- movl $7, 4(%esp)
- call zzz
- addl $28, %esp
- ret
- .size baz, .-baz
- .ident "GCC: (GNU) 4.6.0 20110115 (experimental)"
- .section .note.GNU-stack,"",@progbits
- #endif
- /***************************************************************************/
Add Comment
Please, Sign In to add comment