5 ms·
> Also, in modern compilers, parameter variables are mostly passed to functions via registers, with the stack not being involved at all. Given that this is a C
by mhh__ 6y ago
> Also, in modern compilers, parameter variables are mostly passed to functions via registers, with the stack not being involved at all.
Given that this is a C++ thread I'll be pedantic and say that this is really the ABI rather than the compiler as per se.
- gumby 6y agoABI is a factor in every language;* so I’m not sure I understand the point you’re trying to make. * even interpreted ones, though the calling conventions and layout are quite different from what is typically written up in the documentation of most compiled languages.
- mhh__ 6y agoThe term "modern compiler" was used, which implies that an old compiler might (say) not do so despite complying with some ABI, i.e. the registers aren't an optimization.
- zabzonk 6y agoGiven that the C++ Standard has nothing to say about an ABI (neither does the C Standard, for that matter), then what a compiler does on a particular platform, and what a platform ABI specifies (if it does) are possibly kind of linked.
- mhh__ 6y agoThe word compiler is only mentioned 12 times in the whole standard give or take. My point was that it's not a question of whether the compiler is modern or not, i.e. I work with an old compiler backend on a modern system and it still gets the ABI correct even if it ends up spilling back to memory too often.