This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Ways to fill the stack
- From: sztfg at yandex dot ru
- To: gcc-help at gcc dot gnu dot org
- Date: Sun, 10 Feb 2013 07:41:36 +0400
- Subject: Ways to fill the stack
In this function:
void foo(void)
{
const char a1[6] = {'t','e','s','t','1','2'};
bar(a1);
const char a2[6] = ("test12");
bar(a2);
return;
}
In case of bar(a1) it stores string in this way:
movb $116, -16(%rbp)
movb $101, -15(%rbp)
movb $115, -14(%rbp)
movb $116, -13(%rbp)
movb $49, -12(%rbp)
movb $50, -11(%rbp)
But in case of bar(a2):
movl $1953719668, -32(%rbp)
movw $12849, -28(%rbp)
leaq -32(%rbp), %rax
Can somebody explain me this? Why not use push instruction?