Re: question regarding stack size allocation

From: Raymond Martineau (bk039_at_ncf.ca)
Date: 12/30/04


Date: Thu, 30 Dec 2004 00:39:28 -0500

On 29 Dec 2004 21:07:37 -0800, "ronjon" <ronjoo@gmail.com> wrote:

>I am trying to corelate C code and its associated
>assembly code produced by gcc. In particular,I am
>trying to figure out how the stack pointer increments
>during variable initialization inside a function call.

You are better off asking thefollowing newsgroups:
- news:comp.lang.asm.x86 (x86 assembly language programming)
- news:gnu.gcc (The gcc free C compiler)

>
>I am unable to figure out the pattern in which the
>stack size is incremented above.
>I know this has something to do with word addressing
>in intel processors but the values(of stack pointer
>displacement) dont make sense to me.

It certainly doesn't look like expected behaviour from the compiler.
However, something like this is more suitable on the newsgroups posted
above (ot if it happens to be a bug with the compiler, the maintainers of
gcc.)



Relevant Pages

  • Re: asm volatile
    ... I was wondering what does "asm volatile" do. ... Only for gcc. ... With optimisable inline assembly, the compiler would know that this is a "const" or "pure" function - one whose results depend entirely on its inputs, and has no side effects. ... The compiler is also able to provide the assembly code with registers that it may use - that way, there is no need to save or restore registers unnecessarily around the assembly code. ...
    (comp.arch.embedded)
  • Re: [PATCH] Fix WARN_ON / WARN_ON_ONCE regression
    ... rate on that integer which is causing measurable performance changes? ... The point is valid, __warn_once should be in cache, unless something ... global variable thanks to the older gcc backend assembly code ... The newer version of gcc does not suffer the same ...
    (Linux-Kernel)
  • question regarding stack size allocation
    ... The assembly code produced by gcc is the following: ... movl %esp, %ebp ... subl $4, %esp ... The displacement of the stack pointer changes ...
    (comp.lang.c)
  • [PATCH 2/5] Hostfs: remove unused var
    ... From: Paolo 'Blaisorblade' Giarrusso ... generated assembly code, in fact (gcc should trigger a warning for unused value ...
    (Linux-Kernel)
  • GCC generated assembly
    ... I've looked at the assembly code generated by GCC, but I am not able to ... % mov %esp, %ebp ... Interestingly, if I change the buffer size from 16 to 32 bytes, buf1 is ...
    (freebsd-hackers)

Loading