Working with GCC’s tunable parameters¶
GCC has numerous tunable parameters, which are integer values, tweakable at the command-line by:
--param <name>=<value>
A detailed description of the current parameters (in GCC 4.6.0) can be seen at http://gcc.gnu.org/onlinedocs/gcc-4.6.0/gcc/Optimize-Options.html#Optimize-Options (search for “–param” on that page; there doesn’t seem to be an anchor to the list)
The parameters are visible from Python scripts using the following API:
-
gcc.
get_parameters
()¶ Returns a dictionary, mapping from the option names to
gcc.Parameter
instances
-
class
gcc.
Parameter
¶ -
option
¶ (string) The name used with the command-line –param switch to set this value
-
current_value
¶ (int/long)
-
default_value
¶ (int/long)
-
min_value
¶ (int/long) The minimum acceptable value
-
max_value
¶ (int/long) The maximum acceptable value, if greater than min_value
-
help
¶ (string) A short description of the option.
-