When launched gccwith optimization on-on, it clones (duplicates) C-functions when it considers that the function is in a hot path or there are constants that apply to the arguments of the function.
gcc
In particular, this is apparently controlled by the option fipa-cp-clone.
fipa-cp-clone
Is there any way to influence this? For example, mark one parameter with some attribute as a compile-time constant (how can you do in C ++ with a template parameter), which will cause the function to clone?
, ( , - ). GCC , , ; , . , ( ), , , .
, , , , , GCC , . , , , , .