in reply to Re^6: Help me to understand increment / decrement operator behavior in perl
in thread Help me to understand increment / decrement operator behavior in perl

Well, in that same asm output, there's sub rsp, 56 (make room for the stack frame), then mov DWORD PTR a$[rsp], 10 (initializes the a variable on stack). In other words, variables are placed on stack.

Regarding the push+pop: it takes fewer bytes. 2+1 == 3 vs 5 bytes of immediate mov.

Replies are listed 'Best First'.
Re^8: Help me to understand increment / decrement operator behavior in perl
by BrowserUk (Patriarch) on Mar 05, 2015 at 12:05 UTC
    Well, in that same asm output, there's sub rsp, 56 (make room for the stack frame), then mov DWORD PTR a$rsp, 10 (initializes the a variable on stack). In other words, variables are placed on stack.

    Of course the C compiler uses the stack; just not for performing an integer comparison.

    The question is whether any C compiler would move a numeric value to the stack in order to compare it against another numeric value; not whether one or both of those values might have transitioned through the stack on their way to the point of comparison. So, I'm lost as to what point you are trying to make.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked