Optimization of parameters of compiler functions

Function parameters are pushed onto the stack, but compilers can optimize this task with optional registers. It would be reasonable that this optimization will begin if there are only 1-2 parameters, and not when 256 (not that it would be necessary to have the maximum number of parameters).

How to find out the limit value of a parameter (the number of parameters) for a specific compiler (for example, gcc), where you can be sure that this optimization will be used?

+3
source share
3 answers

Function parameters are pushed onto the stack, but compilers can optimize this task with additional registers.

FrankH , , , , - .

, x86 32- . , , Win32 , , .

, , "", , , . . , , , , - .

ABI/ ? , , .., , , . , , - , ? , , , . , , , ?

, , , ABI:

. :

DOS . 32- Windows - . , . , (DLL) .

, , , . . . , (-OX), , ,

+4

ABI. , , .

+2

. , . OSS, gcc, , , .

0

Source: https://habr.com/ru/post/1786939/


All Articles